// FFACE Helper Class By: T3knicalD3ath
// Version 3 Beta

using System;
using System.Text;
using System.Collections.Generic;
using System.Runtime.InteropServices;

namespace FFXI
{
    class Settings
    {
        public static int DiffNInc = 3;
    }

    public static class FFACE
    {
        #region "Main"

        public class Main
        {
            //Public Declare Ansi Function FFXiIsOpen Lib "FFACE.dll" Alias "FfxiIsOpen" () As Boolean
            [DllImport("FFACE.dll", EntryPoint = "FfxiIsOpen")]
            public static extern bool FFXiIsOpen();
            //Public Declare Ansi Function DllVersionMajor Lib "FFACE.dll" Alias "GetDllVersionMajor" () As Byte
            [DllImport("FFACE.dll", EntryPoint = "GetDllVersionMajor")]
            public static extern byte DllVersionMajor();
            //Public Declare Ansi Function DllVersionMinor Lib "FFACE.dll" Alias "GetDllVersionMinor" () As Byte
            [DllImport("FFACE.dll", EntryPoint = "GetDllVersionMinor")]
            public static extern byte DllVersionMinor();
            //Public Declare Ansi Function DllVersionRevision Lib "FFACE.dll" Alias "GetDllVersionRevision" () As Byte
            [DllImport("FFACE.dll", EntryPoint = "GetDllVersionRevision")]
            public static extern byte DllVersionRevision();
            //Public Declare Ansi Function Weather Lib "FFACE.dll" Alias "GetweatherType" () As eWeather
            [DllImport("FFACE.dll", EntryPoint = "GetweatherType")]
            public static extern eWeather Weather();
            //Public Declare Ansi Function KeyboardMode Lib "FFACE.dll" Alias "GetKeyboardMode" () As Byte
            [DllImport("FFACE.dll", EntryPoint = "GetKeyboardMode")]
            public static extern byte KeyboardMode();
            //Public Declare Ansi Function InitFFACE Lib "FFACE.dll" Alias "InitFFACE" () As Boolean
            [DllImport("FFACE.dll", EntryPoint = "InitFFACE")]
            public static extern bool InitFFACE();
        }

        #endregion

        #region "NPC"

        public class NPC
        {
            //Public Declare Ansi Function IsActive Lib "FFACE.dll" Alias "NPCIsActive" (ByVal index As Short) As Boolean
            [DllImport("FFACE.dll", EntryPoint = "NPCIsActive")]
            public static extern Boolean IsActive(short index);
            //Private Declare Ansi Sub sName Lib "FFACE.dll" Alias "GetNPCName" (ByVal index As Short, ByVal buffer() As Byte, ByRef size As Integer)
            [DllImport("FFACE.dll", EntryPoint = "GetNPCName")]
            public static extern void sName(short index, byte[] buffer, ref int size);

            //Public Shared Function Name(ByVal index As Short) As String
            //    Dim s As Integer = 20
            //    Dim b(20) As Byte
            //    sName(index, b, s)
            //    Return System.Text.Encoding.ASCII.GetString(b, 0, s - 1)
            //End Function
            public static string Name(short index)
            {
                int s = 20;
                byte[] b = new byte[21];
                sName(index, b, ref s);
                return System.Text.Encoding.ASCII.GetString(b, 0, s - 1);
            }

            //Public Declare Ansi Function PosX Lib "FFACE.dll" Alias "GetNPCPosX" (ByVal index As Short) As Single
            [DllImport("FFACE.dll", EntryPoint = "GetNPCPosX")]
            public static extern Single PosX(short index);
            //Public Declare Ansi Function PosY Lib "FFACE.dll" Alias "GetNPCPosY" (ByVal index As Short) As Single
            [DllImport("FFACE.dll", EntryPoint = "GetNPCPosY")]
            public static extern Single PosY(short index);
            //Public Declare Ansi Function PosZ Lib "FFACE.dll" Alias "GetNPCPosZ" (ByVal index As Short) As Single
            [DllImport("FFACE.dll", EntryPoint = "GetNPCPosZ")]
            public static extern Single PosZ(short index);
            //Public Declare Ansi Function PosH Lib "FFACE.dll" Alias "GetNPCPosH" (ByVal index As Short) As Single
            [DllImport("FFACE.dll", EntryPoint = "GetNPCPosH")]
            public static extern Single PosH(short index);

            public static String GetNPCsDirection(short index)
            {
                string TempDirection = "";
                short TempShort = index;

                Int32 PlayersPosZ = Convert.ToInt32(Player.PosZ());
                Int32 PlayersPosX = Convert.ToInt32(Player.PosX());

                Int32 NPCsPosZ = Convert.ToInt32(NPC.PosZ(index));
                Int32 NPCsPosX = Convert.ToInt32(NPC.PosX(index));

                if (NPCsPosZ == PlayersPosZ && NPCsPosX == PlayersPosX)
                {
                    TempDirection = "In Front of You";
                }
                else if (NPCsPosZ > PlayersPosZ && NPCsPosX > PlayersPosX)
                {
                    TempDirection = "NE";
                }
                else if (NPCsPosZ < PlayersPosZ && NPCsPosX < PlayersPosX)
                {
                    TempDirection = "SW";
                }
                else if (NPCsPosZ > PlayersPosZ && NPCsPosX < PlayersPosX)
                {
                    TempDirection = "NW";
                }
                else if (NPCsPosZ < PlayersPosZ && NPCsPosX > PlayersPosX)
                {
                    TempDirection = "SE";
                }
                else if (NPCsPosZ < PlayersPosZ)
                {
                    TempDirection = "S";
                }
                else if (NPCsPosZ > PlayersPosZ)
                {
                    TempDirection = "N";
                }
                else if (NPCsPosX < PlayersPosX)
                {
                    TempDirection = "W";
                }
                else if (NPCsPosX > PlayersPosX)
                {
                    TempDirection = "E";
                }

                return TempDirection;
            }

            //Public Declare Ansi Function Status Lib "FFACE.dll" Alias "GetNPCStatus" (ByVal index As Short) As Byte
            [DllImport("FFACE.dll", EntryPoint = "GetNPCStatus")]
            public static extern eStatus Status(short index);
            //Public Declare Ansi Function HPP Lib "FFACE.dll" Alias "GetNPCHPP" (ByVal index As Short) As Byte
            [DllImport("FFACE.dll", EntryPoint = "GetNPCHPP")]
            public static extern Byte HPP(short index);
            //Public Declare Ansi Function PetID Lib "FFACE.dll" Alias "GetNPCPetID" (ByVal index As Integer) As Short
            [DllImport("FFACE.dll", EntryPoint = "GetNPCPetId")]
            public static extern short PetID(int index);
            //Public Declare Ansi Function PetTP Lib "FFACE.dll" Alias "GetNPCPetTP" (ByVal index As Integer) As Short
            [DllImport("FFACE.dll", EntryPoint = "GetNPCPetTP")]
            public static extern short PetTP(int index);
        }

        #endregion

        #region "Player"

        public class Player
        {
            //Public Declare Ansi Function CastMax Lib "FFACE.dll" Alias "GetCastMax" () As Single
            [DllImport("FFACE.dll", EntryPoint = "GetCastMax")]
            public static extern Single CastMax();
            //Public Declare Ansi Function CastCountDown Lib "FFACE.dll" Alias "GetCastCountDown" () As Single
            [DllImport("FFACE.dll", EntryPoint = "GetCastCountDown")]
            public static extern Single CastCountDown();
            //Public Declare Ansi Function CastPercent Lib "FFACE.dll" Alias "GetCastPercent" () As Single
            [DllImport("FFACE.dll", EntryPoint = "GetCastPercent")]
            public static extern Single CastPercent();
            //Public Declare Ansi Function ViewMode Lib "FFACE.dll" Alias "GetViewMode" () As Byte
            [DllImport("FFACE.dll", EntryPoint = "GetViewMode")]
            public static extern Byte ViewMode();
            //Public Declare Ansi Function Status Lib "FFACE.dll" Alias "GetPlayerStatus" () As eStatus
            [DllImport("FFACE.dll", EntryPoint = "GetPlayerStatus")]
            public static extern eStatus Status();
            //Public Declare Ansi Function Zone Lib "FFACE.dll" Alias "GetPlayerZone" () As Short
            [DllImport("FFACE.dll", EntryPoint = "GetPlayerZone")]
            private static extern short Zone();

            public static string GetPlayerZoneName()
            {
                switch (Zone())
                {
                    case 1:
                        return "Phanauet Channel";
                    case 2:
                        return "Carpenter's Landing";
                    case 3:
                        return "Manaclipper";
                    case 4:
                        return "Bibiki Bay";
                    case 5:
                        return "Uleguerand Range";
                    case 6:
                        return "Bearclaw Pinnacle";
                    case 7:
                        return "Attohwa Chasm";
                    case 8:
                        return "Valley Of Sorrows";
                    case 9:
                        return "Pso'Xja";
                    case 10:
                        return "Shrouded Maw";
                    case 11:
                        return "Oldton Movalpolis";
                    case 12:
                        return "Newton Movalpolis";
                    case 13:
                        return "Mineshaft #2716";
                    case 14:
                        return "Hall of Transference";
                    case 16:
                        return "Promyvion Holla";
                    case 17:
                        return "Spire of Holla";
                    case 18:
                        return "Promyvion Dem";
                    case 19:
                        return "Spire of Dem";
                    case 20:
                        return "Promyvion Mea";
                    case 21:
                        return "Spire of Mea";
                    case 22:
                        return "Promyvion Vahzl";
                    case 23:
                        return "Spire of Vazhl";
                    case 24:
                        return "Lufaise Meadows";
                    case 25:
                        return "Misareaux Coast";
                    case 26:
                        return "Tavnazian Safehold";
                    case 27:
                        return "Phomiuna Aqueducts";
                    case 28:
                        return "Sacrarium";
                    case 29:
                        return "Riverne - Site #B01";
                    case 30:
                        return "Riverne - Site #A01";
                    case 31:
                        return "Monarch Linn";
                    case 32:
                        return "Sealion's Den";
                    case 33:
                        return "Al'Taieu";
                    case 34:
                        return "Grand Palace of Hu'Xzoi";
                    case 35:
                        return "The Garden of Ru'Hmet";
                    case 36:
                        return "Stellar Fulcrum";
                    case 37:
                        return "Heaven's Tower";
                    case 38:
                        return "Hall of Transference";
                    case 39:
                        return "Dynamis Valkurm";
                    case 40:
                        return "Dynamis Buberimu";
                    case 41:
                        return "Dynamis Qufim";
                    case 42:
                        return "Dynamis Tavnazia";
                    case 43:
                        return "Bibiki Bay - Purgonorgo Isle";
                    case 44:
                        return "Bibiki Bay - Purgonorgo Isle";
                    case 48:
                        return "Al Zahbi";
                    case 50:
                        return "Aht Urgan Whitegate";
                    case 51:
                        return "Wajaom Woodlands";
                    case 52:
                        return "Bhaflau Thickets";
                    case 53:
                        return "Nashmau";
                    case 54:
                        return "Arrapago Reef";
                    case 55:
                        return "Ilrusi Atoll";
                    case 56:
                        return "Periqia";
                    case 57:
                        return "Talacca Cove";
                    case 58:
                        return "Silver Sea Route to Nashmau";
                    case 59:
                        return "Silver Sea Route to Al Zahbi";
                    case 61:
                        return "Mount Zhayolm";
                    case 62:
                        return "Halvung";
                    case 63:
                        return "Lebros Cavern";
                    case 65:
                        return "Mamook";
                    case 66:
                        return "Mamool Ja Training Grounds";
                    case 68:
                        return "Aydeewa Subterrane";
                    case 69:
                        return "Leujaoam Sanctum";
                    case 79:
                        return "Caedarva Mire";
                    case 100:
                        return "Ronfaure West";
                    case 101:
                        return "Ronfaure East";
                    case 102:
                        return "La Theine Plateau";
                    case 103:
                        return "Valkurm Dunes";
                    case 104:
                        return "Jugner Forest";
                    case 105:
                        return "Batallia Downs";
                    case 106:
                        return "Gustaberg North";
                    case 107:
                        return "Gustaberg South";
                    case 108:
                        return "Konschtat Highlands";
                    case 109:
                        return "Pashhow Marchlands";
                    case 110:
                        return "Rolanberry Fields";
                    case 111:
                        return "Beaucedine Glacier";
                    case 112:
                        return "Xarcabard";
                    case 113:
                        return "Cape Terrigan";
                    case 114:
                        return "Altepa Eastern Desert";
                    case 115:
                        return "Sarutabaruta West";
                    case 116:
                        return "Sarutabaruta East";
                    case 117:
                        return "Tahrongi Canyon";
                    case 118:
                        return "Buberimu Peninsula";
                    case 119:
                        return "Meriphataud Mountains";
                    case 120:
                        return "Sauromugue Champaign";
                    case 121:
                        return "Sanctuary of Zi'Tah";
                    case 122:
                        return "Ro'Maeve";
                    case 123:
                        return "Yuhtanga Jungle";
                    case 124:
                        return "Yhoator Jungle";
                    case 125:
                        return "Altepa Western Desert";
                    case 126:
                        return "Qufim Island";
                    case 127:
                        return "Behemoth's Dominion";
                    case 128:
                        return "Valley of Sorrows";
                    case 130:
                        return "Ru'Aun Gardens";
                    case 131:
                        return "Mordion Gaol";
                    case 134:
                        return "Dynamis Beaucedine";
                    case 135:
                        return "Dynamis Xarcabard";
                    case 139:
                        return "Horlais Peak";
                    case 140:
                        return "Ghelsba Outpost";
                    case 141:
                        return "Fort Ghelsba";
                    case 142:
                        return "Yughott Grotto";
                    case 143:
                        return "Palborough Mines";
                    case 144:
                        return "Waughroon Shrine";
                    case 145:
                        return "Giddeus";
                    case 146:
                        return "Balga's Dais";
                    case 147:
                        return "Beadeaux";
                    case 148:
                        return "Qulun Dome";
                    case 149:
                        return "Davoi";
                    case 150:
                        return "Monastic Cavern";
                    case 151:
                        return "Castle Oztroja";
                    case 152:
                        return "Altar Room";
                    case 153:
                        return "Boyahda Tree";
                    case 154:
                        return "Dragon's Aery";
                    case 157:
                        return "Delkfutt's Middle Tower";
                    case 158:
                        return "Delkfutt's Upper Tower";
                    case 159:
                        return "Temple of Uggalepih";
                    case 160:
                        return "Den of Rancor";
                    case 161:
                        return "Castle Zvahl Baileys";
                    case 162:
                        return "Castle Zvahl Keep";
                    case 163:
                        return "Altar Room";
                    case 165:
                        return "Throne Room";
                    case 166:
                        return "Ranguemont Pass";
                    case 167:
                        return "Bostaunieux  Oubliette";
                    case 169:
                        return "Toramarai Canal";
                    case 170:
                        return "Full Moon Fountain";
                    case 172:
                        return "Zeruhn Mines";
                    case 173:
                        return "Korroloka Tunnel";
                    case 174:
                        return "Kuftal Tunnel";
                    case 176:
                        return "Sea Serpent Grotto";
                    case 177:
                        return "Ve'Lugannon Palace";
                    case 178:
                        return "Shrine of Ru'Avitau";
                    case 179:
                        return "Empyreal Paradox";
                    case 180:
                        return "La'Loff Amphitheatre";
                    case 181:
                        return "Stellar Fulcrum";
                    case 183:
                        return "Ground of Decisive Battle";
                    case 184:
                        return "Lower Delkfutt's Tower";
                    case 185:
                        return "Southern San D'Oria";
                    case 186:
                        return "Bastok Mines";
                    case 187:
                        return "Windurst Walls";
                    case 188:
                        return "Ru'Lude Gardens";
                    case 190:
                        return "King Ranperre's Tomb";
                    case 191:
                        return "Dangruf Wadi";
                    case 192:
                        return "Horutoto Ruins";
                    case 193:
                        return "Ordelle's Caves";
                    case 194:
                        return "Horutoto Ruins";
                    case 195:
                        return "Eldieme Necropolis";
                    case 196:
                        return "Gusgen Mines";
                    case 197:
                        return "Crawler's Nest";
                    case 198:
                        return "Maze of Shakrami";
                    case 200:
                        return "Garliage Citadel";
                    case 201:
                        return "Cloister of Gales";
                    case 202:
                        return "Cloister of Thunder";
                    case 203:
                        return "Cloister of Frost";
                    case 204:
                        return "Fei'Yin";
                    case 205:
                        return "Ifrit's Cauldron";
                    case 206:
                        return "Qu'Bia Arena";
                    case 207:
                        return "Cloister of Flames";
                    case 208:
                        return "Quicksand Caves";
                    case 209:
                        return "Cloister of Tremors";
                    case 211:
                        return "Cloister of Storms";
                    case 212:
                        return "Gustav Tunnel";
                    case 213:
                        return "Labyrinth of Onzozo";
                    case 215:
                        return "Jeuno Residential Area";
                    case 216:
                        return "San D'Oria Residential Area";
                    case 217:
                        return "Bastok Residential Area";
                    case 218:
                        return "Windurst Residential Area";
                    case 220:
                        return "Ship from Mhaura to Selbina";
                    case 221:
                        return "Ship from Selbina to Mhaura";
                    case 224:
                        return "Airship from Jeuno to Bastok";
                    case 227:
                        return "Ship from Mhaura to Selbina";
                    case 228:
                        return "Ship from Selbina to Mhaura";
                    case 230:
                        return "Southern San D'Oria";
                    case 231:
                        return "Northern San D'Oria";
                    case 232:
                        return "Port San D'Oria";
                    case 233:
                        return "Chateau D'Oraguille";
                    case 234:
                        return "Bastok Mines";
                    case 235:
                        return "Bastok Markets";
                    case 236:
                        return "Port Bastok";
                    case 237:
                        return "Metalworks";
                    case 238:
                        return "Windurst Woods";
                    case 239:
                        return "Windurst Waters";
                    case 240:
                        return "Port Windurst";
                    case 241:
                        return "Windurst Woods";
                    case 242:
                        return "Heaven's Tower";
                    case 243:
                        return "Ru'Lude Gardens";
                    case 244:
                        return "Upper Jeuno";
                    case 245:
                        return "Lower Jeuno";
                    case 246:
                        return "Port Jeuno";
                    case 247:
                        return "Rabao";
                    case 248:
                        return "Selbina";
                    case 249:
                        return "Mhaura";
                    case 250:
                        return "Kazham";
                    case 251:
                        return "Hall of the Gods";
                    case 252:
                        return "Norg";
                    default:
                        return "Error/Area unknown: " + Convert.ToString(Zone());
                }
            }

            //Public Shared Function PosX() As Single
            //    Return FFACE.PC.PosX(Id())
            //End Function
            public static Single PosX()
            {
                return FFACE.NPC.PosX(Id());
            }

            //Public Shared Function PosY() As Single
            //    Return FFACE.PC.PosY(Id())
            //End Function
            public static Single PosY()
            {
                return FFACE.NPC.PosY(Id());
            }
            //Public Shared Function PosZ() As Single
            //    Return FFACE.PC.PosZ(Id())
            //End Function
            public static Single PosZ()
            {
                return FFACE.NPC.PosZ(Id());
            }
            //Public Shared Function PosH() As Single
            //    Return FFACE.PC.PosH(Id())
            //End Function
            public static Single PosH()
            {
                return FFACE.NPC.PosH(Id());
            }

            //Public Declare Ansi Function Id Lib "FFACE.dll" Alias "GetPlayerId" () As Short
            [DllImport("FFACE.dll", EntryPoint = "GetPlayerId")]
            public static extern short Id();
            //Public Declare Ansi Function HP Lib "FFACE.dll" Alias "GetPlayerHP" () As Integer
            [DllImport("FFACE.dll", EntryPoint = "GetPlayerHP")]
            public static extern int HP();
            //Public Declare Ansi Function MP Lib "FFACE.dll" Alias "GetPlayerMP" () As Integer
            [DllImport("FFACE.dll", EntryPoint = "GetPlayerMP")]
            public static extern int MP();
            //Public Declare Ansi Function TP Lib "FFACE.dll" Alias "GetPlayerTP" () As Short
            [DllImport("FFACE.dll", EntryPoint = "GetPlayerTP")]
            public static extern short TP();
            //Public Declare Ansi Function HPP Lib "FFACE.dll" Alias "GetPlayerHPP" () As Byte
            [DllImport("FFACE.dll", EntryPoint = "GetPlayerHPP")]
            public static extern Byte HPP();
            //Public Declare Ansi Function MPP Lib "FFACE.dll" Alias "GetPlayerMPP" () As Byte
            [DllImport("FFACE.dll", EntryPoint = "GetPlayerMPP")]
            public static extern Byte MPP();
            //Public Declare Ansi Function HPMax Lib "FFACE.dll" Alias "GetPlayerHPMax" () As Integer
            [DllImport("FFACE.dll", EntryPoint = "GetPlayerHPMax")]
            public static extern int HPMax();
            //Public Declare Ansi Function MPMax Lib "FFACE.dll" Alias "GetPlayerMPMax" () As Integer
            [DllImport("FFACE.dll", EntryPoint = "GetPlayerMPMax")]
            public static extern int MPMax();
            //Public Declare Ansi Function MainJob Lib "FFACE.dll" Alias "GetPlayerMainJob" () As Byte
            [DllImport("FFACE.dll", EntryPoint = "GetPlayerMainJob")]
            private static extern Byte MainJob();

            public static string MainJobName()
            {
                switch (MainJob())
                {
                    case 1:
                        return "WAR";
                    case 2:
                        return "MNK";
                    case 3:
                        return "WHM";
                    case 4:
                        return "BLM";
                    case 5:
                        return "RDM";
                    case 6:
                        return "THF";
                    case 7:
                        return "PLD";
                    case 8:
                        return "DRK";
                    case 9:
                        return "BST";
                    case 10:
                        return "BRD";
                    case 11:
                        return "RNG";
                    case 12:
                        return "SAM";
                    case 13:
                        return "NIN";
                    case 14:
                        return "DRG";
                    case 15:
                        return "SMN";
                    case 16:
                        return "BLU";
                    case 17:
                        return "COR";
                    case 18:
                        return "PUP";
                    case 19:
                        return "SCH";
                    case 20:
                        return "DNC";
                    default:
                        return Convert.ToString(MainJob());
                }
            }

            //Public Declare Ansi Function SubJob Lib "FFACE.dll" Alias "GetPlayerSubJob" () As Byte
            [DllImport("FFACE.dll", EntryPoint = "GetPlayerSubJob")]
            private static extern Byte SubJob();

            public static string SubJobName()
            {
                switch (SubJob())
                {
                    case 1:
                        return "WAR";
                    case 2:
                        return "MNK";
                    case 3:
                        return "WHM";
                    case 4:
                        return "BLM";
                    case 5:
                        return "RDM";
                    case 6:
                        return "THF";
                    case 7:
                        return "PLD";
                    case 8:
                        return "DRK";
                    case 9:
                        return "BST";
                    case 10:
                        return "BRD";
                    case 11:
                        return "RNG";
                    case 12:
                        return "SAM";
                    case 13:
                        return "NIN";
                    case 14:
                        return "DRG";
                    case 15:
                        return "SMN";
                    case 16:
                        return "BLU";
                    case 17:
                        return "COR";
                    case 18:
                        return "PUP";
                    case 19:
                        return "SCH";
                    case 20:
                        return "DNC";
                    default:
                        return Convert.ToString(SubJob());
                }
            }

            //Public Declare Ansi Function MainLevel Lib "FFACE.dll" Alias "GetPlayerMainLevel" () As Byte
            [DllImport("FFACE.dll", EntryPoint = "GetPlayerMainLevel")]
            public static extern Byte MainLevel();
            //Public Declare Ansi Function SubLevel Lib "FFACE.dll" Alias "GetPlayerSubLevel" () As Byte
            [DllImport("FFACE.dll", EntryPoint = "GetPlayerSubLevel")]
            public static extern Byte SubLevel();
            //Public Declare Ansi Function XP Lib "FFACE.dll" Alias "GetPlayerXP" () As Short
            [DllImport("FFACE.dll", EntryPoint = "GetPlayerXP")]
            public static extern ushort XP();
            //Public Declare Ansi Function XPMax Lib "FFACE.dll" Alias "GetPlayerXPMax" () As Short
            [DllImport("FFACE.dll", EntryPoint = "GetPlayerXPMax")]
            public static extern ushort XPMax();
            //Public Declare Ansi Function StatusCount Lib "FFACE.dll" Alias "GetStatusCount" () As Byte
            [DllImport("FFACE.dll", EntryPoint = "GetStatusCount")]
            public static extern Byte StatusCount();
            //Public Declare Ansi Function StatusID Lib "FFACE.dll" Alias "GetStatusID" (ByVal index As Byte) As eStatusEffect
            [DllImport("FFACE.dll", EntryPoint = "GetStatusId")]
            public static extern eStatusEffect StatusID(byte index);
            //Public Declare Ansi Function AbilityID Lib "FFACE.dll" Alias "GetAbilityID" (ByVal index As Byte) As Short
            [DllImport("FFACE.dll", EntryPoint = "GetAbilityID")]
            public static extern short AbilityID(byte index);
            //Public Declare Ansi Function SpellRecast Lib "FFACE.dll" Alias "GetSpellRecast" (ByVal index As Byte) As Short
            [DllImport("FFACE.dll", EntryPoint = "GetSpellRecast")]
            public static extern short SpellRecast(eSpellList index);

            public static string RescastTime(eSpellList SpellRecastTime)
            {
                string StringRecastTime;
                Int16 TempSpellRecast;
                TempSpellRecast = SpellRecast(SpellRecastTime);
                StringRecastTime = Convert.ToString(Convert.ToInt32((TempSpellRecast * 1.70) / 100 + 0.4));
                return StringRecastTime;
            }

            //Private Declare Ansi Sub sName Lib "FFACE.dll" Alias "GetPlayerName" (ByVal buffer() As Byte, ByRef size As Integer)
            [DllImport("FFACE.dll", EntryPoint = "GetPlayerName")]
            private static extern void sName(byte[] buffer, ref int size);

            //Public Shared Function Name() As String
            //    Dim s As Integer = 20
            //    Dim b(20) As Byte
            //    sName(b, s)
            //    Return System.Text.Encoding.ASCII.GetString(b, 0, s - 1)
            //End Function
            public static string Name()
            {
                int s = 20;
                byte[] b = new byte[21];
                sName(b, ref s);
                return System.Text.Encoding.ASCII.GetString(b, 0, s - 1);
            }
        }

        #endregion

        #region "Target"

        public class Target
        {
            //Private Declare Ansi Sub sName Lib "FFACE.dll" Alias "GetTargetName" (ByVal buffer() As Byte, ByRef size As Integer)
            [DllImport("FFACE.dll", EntryPoint = "GetTargetName")]
            private static extern void sName(byte[] buffer, ref int size);

            //Public Shared Function Name() As String
            //    Dim s As Integer = 20
            //    Dim b(20) As Byte
            //    sName(b, s)
            //    Return System.Text.Encoding.ASCII.GetString(b, 0, s - 1)
            //End Function
            public static string Name()
            {
                int s = 20;
                byte[] b = new byte[21];
                sName(b, ref s);
                return System.Text.Encoding.ASCII.GetString(b, 0, s - 1);
            }

            //Public Declare Ansi Function HPP Lib "FFACE.dll" Alias "GetTargetHPP" () As Byte
            [DllImport("FFACE.dll", EntryPoint = "GetTargetHPP")]
            public static extern Byte HPP();
            //Public Declare Ansi Function ID Lib "FFACE.dll" Alias "GetTargetId" () As Byte
            [DllImport("FFACE.dll", EntryPoint = "GetTargetId")]
            public static extern Byte ID();
            //Public Declare Ansi Function Status Lib "FFACE.dll" Alias "GetTargetStatus" () As Byte
            [DllImport("FFACE.dll", EntryPoint = "GetTargetStatus")]
            public static extern eStatus Status();
            //Public Declare Ansi Function PosX Lib "FFACE.dll" Alias "GetTargetPosX" () As Single
            [DllImport("FFACE.dll", EntryPoint = "GetTargetPosX")]
            public static extern Single PosX();
            //Public Declare Ansi Function PosY Lib "FFACE.dll" Alias "GetTargetPosY" () As Single
            [DllImport("FFACE.dll", EntryPoint = "GetTargetPosY")]
            public static extern Single PosY();
            //Public Declare Ansi Function PosZ Lib "FFACE.dll" Alias "GetTargetPosZ" () As Single
            [DllImport("FFACE.dll", EntryPoint = "GetTargetPosZ")]
            public static extern Single PosZ();
            //Public Declare Ansi Function PosH Lib "FFACE.dll" Alias "GetTargetPosH" () As Single
            [DllImport("FFACE.dll", EntryPoint = "GetTargetPosH")]
            public static extern Single PosH();
        }

        #endregion

        #region "Party"

        public class Party
        {
            //Public Declare Ansi Function ID Lib "FFACE.dll" Alias "GetPartyMemberID" (ByVal index As Integer) As Short
            [DllImport("FFACE.dll", EntryPoint = "GetPartyMemberID")]
            public static extern short ID(int index);
            //Public Declare Ansi Function TP Lib "FFACE.dll" Alias "GetPartyMemberTP" (ByVal index As Integer) As Byte
            [DllImport("FFACE.dll", EntryPoint = "GetPartyMemberTP")]
            public static extern Byte TP(int index);
            //Public Declare Ansi Function HPP Lib "FFACE.dll" Alias "GetPartyMemberHPP" (ByVal index As Integer) As Byte
            [DllImport("FFACE.dll", EntryPoint = "GetPartyMemberHPP")]
            public static extern Byte HPP(int index);
            //Public Declare Ansi Function MPP Lib "FFACE.dll" Alias "GetPartyMemberMPP" (ByVal index As Integer) As Byte
            [DllImport("FFACE.dll", EntryPoint = "GetPartyMemberMPP")]
            public static extern Byte MPP(int index);
            //Public Declare Ansi Function HP Lib "FFACE.dll" Alias "GetPartyMemberHP" (ByVal index As Integer) As Integer
            [DllImport("FFACE.dll", EntryPoint = "GetPartyMemberHP")]
            public static extern int HP(int index);
            //Public Declare Ansi Function MP Lib "FFACE.dll" Alias "GetPartyMemberMP" (ByVal index As Integer) As Integer
            [DllImport("FFACE.dll", EntryPoint = "GetPartyMemberMP")]
            public static extern int MP(int index);
            //Public Declare Ansi Function Zone Lib "FFACE.dll" Alias "GetPartyMemberZone" (ByVal index As Integer) As Short
            [DllImport("FFACE.dll", EntryPoint = "GetPartyMemberZone")]
            private static extern short Zone(int index);

            public static string GetPartyZoneName(int PartyMember)
            {
                switch (Zone(PartyMember))
                {
                    case 1:
                        return "Phanauet Channel";
                    case 2:
                        return "Carpenter's Landing";
                    case 3:
                        return "Manaclipper";
                    case 4:
                        return "Bibiki Bay";
                    case 5:
                        return "Uleguerand Range";
                    case 6:
                        return "Bearclaw Pinnacle";
                    case 7:
                        return "Attohwa Chasm";
                    case 8:
                        return "Valley Of Sorrows";
                    case 9:
                        return "Pso'Xja";
                    case 10:
                        return "Shrouded Maw";
                    case 11:
                        return "Oldton Movalpolis";
                    case 12:
                        return "Newton Movalpolis";
                    case 13:
                        return "Mineshaft #2716";
                    case 14:
                        return "Hall of Transference";
                    case 16:
                        return "Promyvion Holla";
                    case 17:
                        return "Spire of Holla";
                    case 18:
                        return "Promyvion Dem";
                    case 19:
                        return "Spire of Dem";
                    case 20:
                        return "Promyvion Mea";
                    case 21:
                        return "Spire of Mea";
                    case 22:
                        return "Promyvion Vahzl";
                    case 23:
                        return "Spire of Vazhl";
                    case 24:
                        return "Lufaise Meadows";
                    case 25:
                        return "Misareaux Coast";
                    case 26:
                        return "Tavnazian Safehold";
                    case 27:
                        return "Phomiuna Aqueducts";
                    case 28:
                        return "Sacrarium";
                    case 29:
                        return "Riverne - Site #B01";
                    case 30:
                        return "Riverne - Site #A01";
                    case 31:
                        return "Monarch Linn";
                    case 32:
                        return "Sealion's Den";
                    case 33:
                        return "Al'Taieu";
                    case 34:
                        return "Grand Palace of Hu'Xzoi";
                    case 35:
                        return "The Garden of Ru'Hmet";
                    case 36:
                        return "Stellar Fulcrum";
                    case 37:
                        return "Heaven's Tower";
                    case 38:
                        return "Hall of Transference";
                    case 39:
                        return "Dynamis Valkurm";
                    case 40:
                        return "Dynamis Buberimu";
                    case 41:
                        return "Dynamis Qufim";
                    case 42:
                        return "Dynamis Tavnazia";
                    case 43:
                        return "Bibiki Bay - Purgonorgo Isle";
                    case 44:
                        return "Bibiki Bay - Purgonorgo Isle";
                    case 48:
                        return "Al Zahbi";
                    case 50:
                        return "Aht Urgan Whitegate";
                    case 51:
                        return "Wajaom Woodlands";
                    case 52:
                        return "Bhaflau Thickets";
                    case 53:
                        return "Nashmau";
                    case 54:
                        return "Arrapago Reef";
                    case 55:
                        return "Ilrusi Atoll";
                    case 56:
                        return "Periqia";
                    case 57:
                        return "Talacca Cove";
                    case 58:
                        return "Silver Sea Route to Nashmau";
                    case 59:
                        return "Silver Sea Route to Al Zahbi";
                    case 61:
                        return "Mount Zhayolm";
                    case 62:
                        return "Halvung";
                    case 63:
                        return "Lebros Cavern";
                    case 65:
                        return "Mamook";
                    case 66:
                        return "Mamool Ja Training Grounds";
                    case 68:
                        return "Aydeewa Subterrane";
                    case 69:
                        return "Leujaoam Sanctum";
                    case 79:
                        return "Caedarva Mire";
                    case 100:
                        return "Ronfaure West";
                    case 101:
                        return "Ronfaure East";
                    case 102:
                        return "La Theine Plateau";
                    case 103:
                        return "Valkurm Dunes";
                    case 104:
                        return "Jugner Forest";
                    case 105:
                        return "Batallia Downs";
                    case 106:
                        return "Gustaberg North";
                    case 107:
                        return "Gustaberg South";
                    case 108:
                        return "Konschtat Highlands";
                    case 109:
                        return "Pashhow Marchlands";
                    case 110:
                        return "Rolanberry Fields";
                    case 111:
                        return "Beaucedine Glacier";
                    case 112:
                        return "Xarcabard";
                    case 113:
                        return "Cape Terrigan";
                    case 114:
                        return "Altepa Eastern Desert";
                    case 115:
                        return "Sarutabaruta West";
                    case 116:
                        return "Sarutabaruta East";
                    case 117:
                        return "Tahrongi Canyon";
                    case 118:
                        return "Buberimu Peninsula";
                    case 119:
                        return "Meriphataud Mountains";
                    case 120:
                        return "Sauromugue Champaign";
                    case 121:
                        return "Sanctuary of Zi'Tah";
                    case 122:
                        return "Ro'Maeve";
                    case 123:
                        return "Yuhtanga Jungle";
                    case 124:
                        return "Yhoator Jungle";
                    case 125:
                        return "Altepa Western Desert";
                    case 126:
                        return "Qufim Island";
                    case 127:
                        return "Behemoth's Dominion";
                    case 128:
                        return "Valley of Sorrows";
                    case 130:
                        return "Ru'Aun Gardens";
                    case 131:
                        return "Mordion Gaol";
                    case 134:
                        return "Dynamis Beaucedine";
                    case 135:
                        return "Dynamis Xarcabard";
                    case 139:
                        return "Horlais Peak";
                    case 140:
                        return "Ghelsba Outpost";
                    case 141:
                        return "Fort Ghelsba";
                    case 142:
                        return "Yughott Grotto";
                    case 143:
                        return "Palborough Mines";
                    case 144:
                        return "Waughroon Shrine";
                    case 145:
                        return "Giddeus";
                    case 146:
                        return "Balga's Dais";
                    case 147:
                        return "Beadeaux";
                    case 148:
                        return "Qulun Dome";
                    case 149:
                        return "Davoi";
                    case 150:
                        return "Monastic Cavern";
                    case 151:
                        return "Castle Oztroja";
                    case 152:
                        return "Altar Room";
                    case 153:
                        return "Boyahda Tree";
                    case 154:
                        return "Dragon's Aery";
                    case 157:
                        return "Delkfutt's Middle Tower";
                    case 158:
                        return "Delkfutt's Upper Tower";
                    case 159:
                        return "Temple of Uggalepih";
                    case 160:
                        return "Den of Rancor";
                    case 161:
                        return "Castle Zvahl Baileys";
                    case 162:
                        return "Castle Zvahl Keep";
                    case 163:
                        return "Altar Room";
                    case 165:
                        return "Throne Room";
                    case 166:
                        return "Ranguemont Pass";
                    case 167:
                        return "Bostaunieux  Oubliette";
                    case 169:
                        return "Toramarai Canal";
                    case 170:
                        return "Full Moon Fountain";
                    case 172:
                        return "Zeruhn Mines";
                    case 173:
                        return "Korroloka Tunnel";
                    case 174:
                        return "Kuftal Tunnel";
                    case 176:
                        return "Sea Serpent Grotto";
                    case 177:
                        return "Ve'Lugannon Palace";
                    case 178:
                        return "Shrine of Ru'Avitau";
                    case 179:
                        return "Empyreal Paradox";
                    case 180:
                        return "La'Loff Amphitheatre";
                    case 181:
                        return "Stellar Fulcrum";
                    case 183:
                        return "Ground of Decisive Battle";
                    case 184:
                        return "Lower Delkfutt's Tower";
                    case 185:
                        return "Southern San D'Oria";
                    case 186:
                        return "Bastok Mines";
                    case 187:
                        return "Windurst Walls";
                    case 188:
                        return "Ru'Lude Gardens";
                    case 190:
                        return "King Ranperre's Tomb";
                    case 191:
                        return "Dangruf Wadi";
                    case 192:
                        return "Horutoto Ruins";
                    case 193:
                        return "Ordelle's Caves";
                    case 194:
                        return "Horutoto Ruins";
                    case 195:
                        return "Eldieme Necropolis";
                    case 196:
                        return "Gusgen Mines";
                    case 197:
                        return "Crawler's Nest";
                    case 198:
                        return "Maze of Shakrami";
                    case 200:
                        return "Garliage Citadel";
                    case 201:
                        return "Cloister of Gales";
                    case 202:
                        return "Cloister of Thunder";
                    case 203:
                        return "Cloister of Frost";
                    case 204:
                        return "Fei'Yin";
                    case 205:
                        return "Ifrit's Cauldron";
                    case 206:
                        return "Qu'Bia Arena";
                    case 207:
                        return "Cloister of Flames";
                    case 208:
                        return "Quicksand Caves";
                    case 209:
                        return "Cloister of Tremors";
                    case 211:
                        return "Cloister of Storms";
                    case 212:
                        return "Gustav Tunnel";
                    case 213:
                        return "Labyrinth of Onzozo";
                    case 215:
                        return "Jeuno Residential Area";
                    case 216:
                        return "San D'Oria Residential Area";
                    case 217:
                        return "Bastok Residential Area";
                    case 218:
                        return "Windurst Residential Area";
                    case 220:
                        return "Ship from Mhaura to Selbina";
                    case 221:
                        return "Ship from Selbina to Mhaura";
                    case 224:
                        return "Airship from Jeuno to Bastok";
                    case 227:
                        return "Ship from Mhaura to Selbina";
                    case 228:
                        return "Ship from Selbina to Mhaura";
                    case 230:
                        return "Southern San D'Oria";
                    case 231:
                        return "Northern San D'Oria";
                    case 232:
                        return "Port San D'Oria";
                    case 233:
                        return "Chateau D'Oraguille";
                    case 234:
                        return "Bastok Mines";
                    case 235:
                        return "Bastok Markets";
                    case 236:
                        return "Port Bastok";
                    case 237:
                        return "Metalworks";
                    case 238:
                        return "Windurst Woods";
                    case 239:
                        return "Windurst Waters";
                    case 240:
                        return "Port Windurst";
                    case 241:
                        return "Windurst Woods";
                    case 242:
                        return "Heaven's Tower";
                    case 243:
                        return "Ru'Lude Gardens";
                    case 244:
                        return "Upper Jeuno";
                    case 245:
                        return "Lower Jeuno";
                    case 246:
                        return "Port Jeuno";
                    case 247:
                        return "Rabao";
                    case 248:
                        return "Selbina";
                    case 249:
                        return "Mhaura";
                    case 250:
                        return "Kazham";
                    case 251:
                        return "Hall of the Gods";
                    case 252:
                        return "Norg";
                    default:
                        return "Error/Area unknown";
                }
            }

            //Private Declare Ansi Sub sName Lib "FFACE.dll" Alias "GetPartyMemberName" (ByVal index As Integer, ByVal buffer As Byte(), ByRef size As Integer)
            [DllImport("FFACE.dll", EntryPoint = "GetPartyMemberID")]
            private static extern void sName(int index, byte[] buffer, ref int size);

            //Public Shared Function Name(ByVal index As Integer) As String
            //    Dim s As Integer = 20
            //    Dim b(20) As Byte
            //    sName(index, b, s)
            //    Return System.Text.Encoding.ASCII.GetString(b, 0, s - 1)
            //End Function
            public static string Name(int index)
            {
                int s = 20;
                byte[] b = new byte[21];
                sName(index, b, ref s);
                return System.Text.Encoding.ASCII.GetString(b, 0, s - 1);
            }
        }

        #endregion

        #region "Chat"

        public class Chat
        {
            private struct CHATEXTRAINFO
            {
                public short MessageType;
            }

            public struct ChatLogEntry
            {
                public string LineText;

                public eChatMode LineType;

                public static bool operator ==(ChatLogEntry item1, ChatLogEntry item2)
                {
                    if (item1.LineText == item2.LineText & item1.LineType == item2.LineType)
                    {
                        return true;
                    }
                    else
                    {
                        return false;
                    }
                }

                public static bool operator !=(ChatLogEntry item1, ChatLogEntry item2)
                {
                    return !(item1 == item2);
                }

                public override bool Equals(object o)
                {
                    if (o.GetType() == this.GetType())
                        return (this == (ChatLogEntry)o);
                    else
                        return false;
                }

                public override int GetHashCode()
                {
                    return (LineText.GetHashCode()) & (~(short)LineType);
                }
            }

            [DllImport("FFACE.dll", EntryPoint = "IsNewLine")]
            public static extern bool isNewLine();

            [DllImport("FFACE.dll", EntryPoint = "GetChatLineEx")]
            private static extern void sExtra(short index, byte[] buffer, ref int size, ref CHATEXTRAINFO ex);

            public static ChatLogEntry GetLine(short index)
            {
                int s = 200;
                ChatLogEntry r;
                CHATEXTRAINFO ex = new CHATEXTRAINFO();
                byte[] b = new byte[201];
                sExtra(index, b, ref s, ref ex);

                if (s == 0)
                {
                    r.LineText = "";
                    r.LineType = 0;
                    return r;
                }

                r.LineText = System.Text.Encoding.GetEncoding(932).GetString(b, 0, s - 1);
                r.LineType = (eChatMode)ex.MessageType;
                return r;
            }

            private static Queue<ChatLogEntry> _ChatLog = new Queue<ChatLogEntry>(50);

            private static Queue<ChatLogEntry> _LastAdded = new Queue<ChatLogEntry>(Settings.DiffNInc);

            public static void ClearChatLog()
            {
                _ChatLog.Clear();
            }

            public static void Update()
            {
                try
                {
                    Stack<ChatLogEntry> t = new Stack<ChatLogEntry>((int)Settings.DiffNInc + 3);
                    Queue<ChatLogEntry> n = new Queue<ChatLogEntry>((int)Settings.DiffNInc);
                    short i = 0;
                    byte dc = 1;
                    if (_LastAdded.Count == 0)
                    {
                        for (short j = 0; j <= 49; j++)
                        {
                            if (j < (int)Settings.DiffNInc)
                                _LastAdded.Enqueue(GetLine(j));
                            t.Push(GetLine(j));
                        }
                    }
                    else
                    {
                        for (i = 1; i <= 50; i++)
                        {
                            ChatLogEntry l = GetLine(Convert.ToInt16(i - (byte)1));
                            t.Push(l);
                            if (n.Count < (int)Settings.DiffNInc)
                                n.Enqueue(l);
                            if (t.Peek().LineText == _LastAdded.Peek().LineText)
                            {
                                if (dc < (int)Settings.DiffNInc)
                                {
                                    dc += (byte)1;
                                    _LastAdded.Dequeue();
                                }
                                else
                                {
                                    _LastAdded.Dequeue();
                                    for (int j = 1; j <= (int)Settings.DiffNInc; j++)
                                    {
                                        t.Pop();
                                        _LastAdded.Enqueue(n.Dequeue());
                                    }
                                    break; // TODO: might not be correct. Was : Exit For 
                                }
                            }
                        }
                    }
                    while (t.Count > 0)
                    {
                        _ChatLog.Enqueue(t.Pop());
                    }
                    t.Clear();
                    n.Clear();
                }
                catch { }
            }

            public static void LessFailUpdate()
            {
                Stack<ChatLogEntry> t = new Stack<ChatLogEntry>((int)Settings.DiffNInc + 3);
                Queue<ChatLogEntry> n = new Queue<ChatLogEntry>(50);
                for (short i = 0; i < 50; i++)
                {
                    ChatLogEntry line = GetLine(i);
                    t.Push(line);
                    if (_LastAdded.Count == 0)
                    {
                        n.Enqueue(line);
                    }
                }
                ChatLogEntry tpop = t.Pop();
                while (_LastAdded.Contains(tpop) && t.Count > 0 && _LastAdded.Contains(t.Peek()))
                {
                    tpop = t.Pop();
                }

                while (n.Count > 0)
                {
                    _LastAdded.Enqueue(n.Dequeue());
                }

                while (t.Count > 0)
                {
                    tpop = t.Pop();
                    _LastAdded.Enqueue(tpop);
                    _LastAdded.Dequeue();
                    _ChatLog.Enqueue(tpop);
                }

            }

            public static int NumberOfUnparsedLines()
            {
                return _ChatLog.Count;
            }

            public static string GetNextLine()
            {
                if (NumberOfUnparsedLines() == 0)
                {
                    return "";
                }
                return _ChatLog.Peek().LineText;
            }

            public static eChatMode GetNextLineType()
            {
                if (NumberOfUnparsedLines() == 0)
                {
                    return eChatMode.Unknown;
                }
                return _ChatLog.Peek().LineType;
            }

            public static void LineParsed()
            {
                if (_ChatLog.Count > 0)
                {
                    _ChatLog.Dequeue();
                }
            }
        }

        #endregion

        #region "Skills"

        public class Skills
        {

            //Public Declare Ansi Function Blue Lib "FFACE.dll" Alias "GetBlueSkill" () As Short
            [DllImport("FFACE.dll", EntryPoint = "GetBlueSkill")]
            public static extern short Blue();
            //Public Declare Ansi Function BlueCapped Lib "FFACE.dll" Alias "GetBlueCap" () As Boolean
            [DllImport("FFACE.dll", EntryPoint = "GetBlueCap")]
            public static extern Boolean BlueCapped();
            //Public Declare Ansi Function Dark Lib "FFACE.dll" Alias "GetDarkSkill" () As Short
            [DllImport("FFACE.dll", EntryPoint = "GetDarkSkill")]
            public static extern short Dark();
            //Public Declare Ansi Function DarkCapped Lib "FFACE.dll" Alias "GetDarkCap" () As Boolean
            [DllImport("FFACE.dll", EntryPoint = "GetDarkCap")]
            public static extern Boolean DarkCapped();
            //Public Declare Ansi Function Divine Lib "FFACE.dll" Alias "GetDivineSkill" () As Short
            [DllImport("FFACE.dll", EntryPoint = "GetDivineSkill")]
            public static extern short Divine();
            //Public Declare Ansi Function DivineCapped Lib "FFACE.dll" Alias "GetDivineCap" () As Boolean
            [DllImport("FFACE.dll", EntryPoint = "GetDivineCap")]
            public static extern Boolean DivineCapped();
            //Public Declare Ansi Function Elemental Lib "FFACE.dll" Alias "GetElementalSkill" () As Short
            [DllImport("FFACE.dll", EntryPoint = "GetElementalSkill")]
            public static extern short Elemental();
            //Public Declare Ansi Function ElementalCapped Lib "FFACE.dll" Alias "GetElementalCap" () As Boolean
            [DllImport("FFACE.dll", EntryPoint = "GetElementalCap")]
            public static extern Boolean ElementalCapped();
            //Public Declare Ansi Function Enfeebling Lib "FFACE.dll" Alias "GetEnfeeblingSkill" () As Short
            [DllImport("FFACE.dll", EntryPoint = "GetEnfeeblingSkill")]
            public static extern short Enfeebling();
            //Public Declare Ansi Function EnfeeblingCapped Lib "FFACE.dll" Alias "GetEnfeeblingCap" () As Boolean
            [DllImport("FFACE.dll", EntryPoint = "GetEnfeeblingCap")]
            public static extern Boolean EnfeeblingCapped();
            //Public Declare Ansi Function Enhancing Lib "FFACE.dll" Alias "GetEnhancingSkill" () As Short
            [DllImport("FFACE.dll", EntryPoint = "GetEnhancingSkill")]
            public static extern short Enhancing();
            //Public Declare Ansi Function EnhancingCapped Lib "FFACE.dll" Alias "GetEnhancingCap" () As Boolean
            [DllImport("FFACE.dll", EntryPoint = "GetEnhancingCap")]
            public static extern Boolean EnhancingCapped();
            //Public Declare Ansi Function Healing Lib "FFACE.dll" Alias "GetHealingSkill" () As Short
            [DllImport("FFACE.dll", EntryPoint = "GetHealingSkill")]
            public static extern short Healing();
            //Public Declare Ansi Function HealingCapped Lib "FFACE.dll" Alias "GetHealingCap" () As Boolean
            [DllImport("FFACE.dll", EntryPoint = "GetHealingCap")]
            public static extern Boolean HealingCapped();
            //Public Declare Ansi Function Ninjutsu Lib "FFACE.dll" Alias "GetNinjutsuSkill" () As Short
            [DllImport("FFACE.dll", EntryPoint = "GetNinjutsuSkill")]
            public static extern short Ninjutsu();
            //Public Declare Ansi Function NinjutsuCapped Lib "FFACE.dll" Alias "GetNinjutsuCap" () As Boolean
            [DllImport("FFACE.dll", EntryPoint = "GetNinjutsuCap")]
            public static extern Boolean NinjutsuCapped();
            //Public Declare Ansi Function Singing Lib "FFACE.dll" Alias "GetSingingSkill" () As Short
            [DllImport("FFACE.dll", EntryPoint = "GetSingingSkill")]
            public static extern short Singing();
            //Public Declare Ansi Function SingingCapped Lib "FFACE.dll" Alias "GetSingingCap" () As Boolean
            [DllImport("FFACE.dll", EntryPoint = "GetSingingCap")]
            public static extern Boolean SingingCapped();
            //Public Declare Ansi Function Summon Lib "FFACE.dll" Alias "GetSummonSkill" () As Short
            [DllImport("FFACE.dll", EntryPoint = "GetSummonSkill")]
            public static extern short Summon();
            //Public Declare Ansi Function SummonCapped Lib "FFACE.dll" Alias "GetSummonCap" () As Boolean
            [DllImport("FFACE.dll", EntryPoint = "GetSummonCap")]
            public static extern Boolean SummonCapped();
            //Public Declare Ansi Function Stringed Lib "FFACE.dll" Alias "GetStringedSkill" () As Short
            [DllImport("FFACE.dll", EntryPoint = "GetStringedSkill")]
            public static extern short Stringed();
            //Public Declare Ansi Function StringedCapped Lib "FFACE.dll" Alias "GetStringedCap" () As Boolean
            [DllImport("FFACE.dll", EntryPoint = "GetStringedCap")]
            public static extern Boolean StringedCapped();
            //Public Declare Ansi Function Wind Lib "FFACE.dll" Alias "GetWindSkill" () As Short
            [DllImport("FFACE.dll", EntryPoint = "GetWindSkill")]
            public static extern short Wind();
            //Public Declare Ansi Function WindCapped Lib "FFACE.dll" Alias "GetWindCap" () As Boolean
            [DllImport("FFACE.dll", EntryPoint = "GetWindCap")]
            public static extern Boolean WindCapped();
            //Public Declare Ansi Function H2H Lib "FFACE.dl" Alias "GetWindSkill" () As Short
            [DllImport("FFACE.dll", EntryPoint = "GetH2HSkill")]
            public static extern short H2H();
            //Public Declare Ansi Function H2HCapped Lib "FFACE.dl" Alias "GetH2HCap" () As Boolean
            [DllImport("FFACE.dll", EntryPoint = "GetH2HCap")]
            public static extern Boolean H2HCapped();
            //Public Declare Ansi Function Dagger Lib "FFACE.dl" Alias "GetDaggerSkill" () As Short
            [DllImport("FFACE.dll", EntryPoint = "GetDaggerSkill")]
            public static extern short Dagger();
            //Public Declare Ansi Function DaggerCapped Lib "FFACE.dl" Alias "GetDaggerCap" () As Boolean
            [DllImport("FFACE.dll", EntryPoint = "GetDaggerCap")]
            public static extern Boolean DaggerCapped();
            //Public Declare Ansi Function Sword Lib "FFACE.dl" Alias "GetSwordSkill" () As Short
            [DllImport("FFACE.dll", EntryPoint = "GetSwordSkill")]
            public static extern short Sword();
            //Public Declare Ansi Function SwordCapped Lib "FFACE.dl" Alias "GetSwordCap" () As Boolean
            [DllImport("FFACE.dll", EntryPoint = "GetSwordCap")]
            public static extern Boolean SwordCapped();
            //Public Declare Ansi Function GreatSword Lib "FFACE.dl" Alias "GetGreatSwordSkill" () As Short
            [DllImport("FFACE.dll", EntryPoint = "GetGreatSwordSkill")]
            public static extern short GreatSword();
            //Public Declare Ansi Function GreatSwordCapped Lib "FFACE.dl" Alias "GetGreatSwordCap" () As Boolean
            [DllImport("FFACE.dll", EntryPoint = "GetGreatSwordCap")]
            public static extern Boolean GreatSwordCapped();
            //Public Declare Ansi Function Axe Lib "FFACE.dl" Alias "GetAxeSkill" () As Short
            [DllImport("FFACE.dll", EntryPoint = "GetAxeSkill")]
            public static extern short Axe();
            //Public Declare Ansi Function AxeCapped Lib "FFACE.dl" Alias "GetAxeCap" () As Boolean
            [DllImport("FFACE.dll", EntryPoint = "GetAxeCap")]
            public static extern Boolean AxeCapped();
            //Public Declare Ansi Function GreatAxe Lib "FFACE.dl" Alias "GetGreatAxeSkill" () As Short
            [DllImport("FFACE.dll", EntryPoint = "GetGreatAxeSkill")]
            public static extern short GreatAxe();
            //Public Declare Ansi Function GreatAxeCapped Lib "FFACE.dl" Alias "GetGreatAxeCap" () As Boolean
            [DllImport("FFACE.dll", EntryPoint = "GetGreatAxeCap")]
            public static extern Boolean GreatAxeCapped();
            //Public Declare Ansi Function Scythe Lib "FFACE.dl" Alias "GetScytheSkill" () As Short
            [DllImport("FFACE.dll", EntryPoint = "GetScytheSkill")]
            public static extern short Scythe();
            //Public Declare Ansi Function ScytheCapped Lib "FFACE.dl" Alias "GetScytheCap" () As Boolean
            [DllImport("FFACE.dll", EntryPoint = "GetScytheCap")]
            public static extern Boolean ScytheCapped();
            //Public Declare Ansi Function Polearm Lib "FFACE.dl" Alias "GetPolearmSkill" () As Short
            [DllImport("FFACE.dll", EntryPoint = "GetPolearmSkill")]
            public static extern short Polearm();
            //Public Declare Ansi Function PolearmCapped Lib "FFACE.dl" Alias "GetPolearmCap" () As Boolean
            [DllImport("FFACE.dll", EntryPoint = "GetPolearmCap")]
            public static extern Boolean PolearmCapped();
            //Public Declare Ansi Function Katana Lib "FFACE.dl" Alias "GetKatanaSkill" () As Short
            [DllImport("FFACE.dll", EntryPoint = "GetKatanaSkill")]
            public static extern short Katana();
            //Public Declare Ansi Function KatanaCapped Lib "FFACE.dl" Alias "GetKatanaCap" () As Boolean
            [DllImport("FFACE.dll", EntryPoint = "GetKatanaCap")]
            public static extern Boolean KatanaCapped();
            //Public Declare Ansi Function GreatKatana Lib "FFACE.dl" Alias "GetGreatKatanaSkill" () As Short
            [DllImport("FFACE.dll", EntryPoint = "GetGreatKatanaSkill")]
            public static extern short GreatKatana();
            //Public Declare Ansi Function GreatKatanaCapped Lib "FFACE.dl" Alias "GetGreatKatanaCap" () As Boolean
            [DllImport("FFACE.dll", EntryPoint = "GetGreatKatanaCap")]
            public static extern Boolean GreatKatanaCapped();
            //Public Declare Ansi Function Club Lib "FFACE.dl" Alias "GetClubSkill" () As Short
            [DllImport("FFACE.dll", EntryPoint = "GetClubSkill")]
            public static extern short Club();
            //Public Declare Ansi Function ClubCapped Lib "FFACE.dl" Alias "GetClubCap" () As Boolean
            [DllImport("FFACE.dll", EntryPoint = "GetClubCap")]
            public static extern Boolean ClubCapped();
            //Public Declare Ansi Function Staff Lib "FFACE.dl" Alias "GetStaffSkill" () As Short
            [DllImport("FFACE.dll", EntryPoint = "GetStaffSkill")]
            public static extern short Staff();
            //Public Declare Ansi Function StaffCapped Lib "FFACE.dl" Alias "GetStaffCap" () As Boolean
            [DllImport("FFACE.dll", EntryPoint = "GetStaffCap")]
            public static extern Boolean StaffCapped();
            //Public Declare Ansi Function Archery Lib "FFACE.dl" Alias "GetArcherySkill" () As Short
            [DllImport("FFACE.dll", EntryPoint = "GetArcherySkill")]
            public static extern short Archery();
            //Public Declare Ansi Function ArcheryCapped Lib "FFACE.dl" Alias "GetArcheryCap" () As Boolean
            [DllImport("FFACE.dll", EntryPoint = "GetArcheryCap")]
            public static extern Boolean ArcheryCapped();
            //Public Declare Ansi Function Marksmanship Lib "FFACE.dl" Alias "GetMarksmanshipSkill" () As Short
            [DllImport("FFACE.dll", EntryPoint = "GetMarksmanshipSkill")]
            public static extern short Marksmanship();
            //Public Declare Ansi Function MarksmanshipCapped Lib "FFACE.dl" Alias "GetMarksmanshipCap" () As Boolean
            [DllImport("FFACE.dll", EntryPoint = "GetMarksmanshipCap")]
            public static extern Boolean MarksmanshipCapped();
            //Public Declare Ansi Function Throwing Lib "FFACE.dl" Alias "GetThrowingSkill" () As Short
            [DllImport("FFACE.dll", EntryPoint = "GetThrowingSkill")]
            public static extern short Throwing();
            //Public Declare Ansi Function ThrowingCapped Lib "FFACE.dl" Alias "GetThrowingCap" () As Boolean
            [DllImport("FFACE.dll", EntryPoint = "GetThrowingCap")]
            public static extern Boolean ThrowingCapped();
            //Public Declare Ansi Function Gaurding Lib "FFACE.dl" Alias "GetGaurdingSkill" () As Short
            [DllImport("FFACE.dll", EntryPoint = "GetGaurdingSkill")]
            public static extern short Gaurding();
            //Public Declare Ansi Function GaurdingCapped Lib "FFACE.dl" Alias "GetGaurdingCap" () As Boolean
            [DllImport("FFACE.dll", EntryPoint = "GetGaurdingCap")]
            public static extern Boolean GaurdingCapped();
            //Public Declare Ansi Function Evasion Lib "FFACE.dl" Alias "GetEvasionSkill" () As Short
            [DllImport("FFACE.dll", EntryPoint = "GetEvasionSkill")]
            public static extern short Evasion();
            //Public Declare Ansi Function EvasionCapped Lib "FFACE.dl" Alias "GetEvasionCap" () As Boolean
            [DllImport("FFACE.dll", EntryPoint = "GetEvasionCap")]
            public static extern Boolean EvasionCapped();
            //Public Declare Ansi Function Shield Lib "FFACE.dl" Alias "GetShieldSkill" () As Short
            [DllImport("FFACE.dll", EntryPoint = "GetShieldSkill")]
            public static extern short Shield();
            //Public Declare Ansi Function ShieldCapped Lib "FFACE.dl" Alias "GetShieldCap" () As Boolean
            [DllImport("FFACE.dll", EntryPoint = "GetShieldCap")]
            public static extern Boolean ShieldCapped();
            //Public Declare Ansi Function Parrying Lib "FFACE.dl" Alias "GetParryingSkill" () As Short
            [DllImport("FFACE.dll", EntryPoint = "GetParryingSkill")]
            public static extern short Parrying();
            //Public Declare Ansi Function ParryingCapped Lib "FFACE.dl" Alias "GetParryingCap" () As Boolean
            [DllImport("FFACE.dll", EntryPoint = "GetParryingCap")]
            public static extern Boolean ParryingCapped();

            public static short SkillLevel(eSkill skill)
            {
                switch (skill)
                {
                    case eSkill.Blue_Magic:
                        return Blue();
                    case eSkill.Dark_Magic:
                        return Dark();
                    case eSkill.Divine_Magic:
                        return Divine();
                    case eSkill.Elemental_Magic:
                        return Elemental();
                    case eSkill.Enfeebling_Magic:
                        return Enfeebling();
                    case eSkill.Enhancing_Magic:
                        return Enhancing();
                    case eSkill.Healing_Magic:
                        return Healing();
                    case eSkill.Ninjutsu_Magic:
                        return Ninjutsu();
                    case eSkill.Summoning_Magic:
                        return Summon();
                    case eSkill.Singing:
                        return Singing();
                    case eSkill.Stringed_Instrument:
                        return Stringed();
                    case eSkill.Wind_Instrument:
                        return Wind();
                    case eSkill.H2H_Combat:
                        return H2H();
                    case eSkill.Dagger_Combat:
                        return Dagger();
                    case eSkill.Sword_Combat:
                        return Sword();
                    case eSkill.GreatSword_Combat:
                        return GreatSword();
                    case eSkill.Axe_Combat:
                        return Axe();
                    case eSkill.GreatAxe_Combat:
                        return GreatAxe();
                    case eSkill.Scythe_Combat:
                        return Scythe();
                    case eSkill.Polearm_Combat:
                        return Polearm();
                    case eSkill.Katana_Combat:
                        return Katana();
                    case eSkill.GreatKatana_Combat:
                        return GreatKatana();
                    case eSkill.Club_Combat:
                        return Club();
                    case eSkill.Staff_Combat:
                        return Staff();
                    case eSkill.Archery_Ranged:
                        return Archery();
                    case eSkill.Marksmanship_Ranged:
                        return Marksmanship();
                    case eSkill.Throwing_Ranged:
                        return Throwing();
                    case eSkill.Guard_Defense:
                        return Gaurding();
                    case eSkill.Evasion_Defense:
                        return Evasion();
                    case eSkill.Shield_Defense:
                        return Shield();
                    case eSkill.Parrying_Defense:
                        return Parrying();
                    default:
                        return -1;
                }
            }
            public static Boolean SkillCapped(eSkill skill)
            {
                switch (skill)
                {
                    case eSkill.Blue_Magic:
                        return BlueCapped();
                    case eSkill.Dark_Magic:
                        return DarkCapped();
                    case eSkill.Divine_Magic:
                        return DivineCapped();
                    case eSkill.Elemental_Magic:
                        return ElementalCapped();
                    case eSkill.Enfeebling_Magic:
                        return EnfeeblingCapped();
                    case eSkill.Enhancing_Magic:
                        return EnhancingCapped();
                    case eSkill.Healing_Magic:
                        return HealingCapped();
                    case eSkill.Ninjutsu_Magic:
                        return NinjutsuCapped();
                    case eSkill.Summoning_Magic:
                        return SummonCapped();
                    case eSkill.Singing:
                        return SingingCapped();
                    case eSkill.Stringed_Instrument:
                        return StringedCapped();
                    case eSkill.Wind_Instrument:
                        return WindCapped();
                    case eSkill.H2H_Combat:
                        return H2HCapped();
                    case eSkill.Dagger_Combat:
                        return DaggerCapped();
                    case eSkill.Sword_Combat:
                        return SwordCapped();
                    case eSkill.GreatSword_Combat:
                        return GreatSwordCapped();
                    case eSkill.Axe_Combat:
                        return AxeCapped();
                    case eSkill.GreatAxe_Combat:
                        return GreatAxeCapped();
                    case eSkill.Scythe_Combat:
                        return ScytheCapped();
                    case eSkill.Polearm_Combat:
                        return PolearmCapped();
                    case eSkill.Katana_Combat:
                        return KatanaCapped();
                    case eSkill.GreatKatana_Combat:
                        return GreatKatanaCapped();
                    case eSkill.Club_Combat:
                        return ClubCapped();
                    case eSkill.Staff_Combat:
                        return StaffCapped();
                    case eSkill.Archery_Ranged:
                        return ArcheryCapped();
                    case eSkill.Marksmanship_Ranged:
                        return MarksmanshipCapped();
                    case eSkill.Throwing_Ranged:
                        return ThrowingCapped();
                    case eSkill.Guard_Defense:
                        return GaurdingCapped();
                    case eSkill.Evasion_Defense:
                        return EvasionCapped();
                    case eSkill.Shield_Defense:
                        return ShieldCapped();
                    case eSkill.Parrying_Defense:
                        return ParryingCapped();
                    default:
                        return false;
                }
            }
        }

        #endregion

        #region "Fishing"

        public class Fishing
        {
            //Public Declare Ansi Function OnLine Lib "FFACE.dll" Alias "FishOnLine" () As Integer            
            [DllImport("FFACE.dll", EntryPoint = "FishOnLine")]
            public static extern int OnLine();
            //Public Declare Ansi Function RodPosition Lib "FFACE.dll" Alias "GetRodPosition" () As eRodAlign
            [DllImport("FFACE.dll", EntryPoint = "GetRodPosition")]
            public static extern eRodAlign RodPosition();

            public class Fish
            {
                //Public Declare Ansi Function HPMax Lib "FFACE.dll" Alias "GetFishHPMax" () As Integer
                [DllImport("FFACE.dll", EntryPoint = "GetFishHPMax")]
                public static extern int HPMax();
                //Public Declare Ansi Function HP Lib "FFACE.dll" Alias "GetFishHP" () As Integer
                [DllImport("FFACE.dll", EntryPoint = "GetFishHP")]
                public static extern int HP();
                //Public Declare Ansi Function ID1 Lib "FFACE.dll" Alias "GetFishID1" () As Integer
                [DllImport("FFACE.dll", EntryPoint = "GetFishID1")]
                public static extern int ID1();
                //Public Declare Ansi Function ID2 Lib "FFACE.dll" Alias "GetFishID2" () As Integer
                [DllImport("FFACE.dll", EntryPoint = "GetFishID2")]
                public static extern int ID2();
                //Public Declare Ansi Function ID3 Lib "FFACE.dll" Alias "GetFishID3" () As Integer
                [DllImport("FFACE.dll", EntryPoint = "GetFishID3")]
                public static extern int ID3();
                //Public Declare Ansi Function ID4 Lib "FFACE.dll" Alias "GetFishID4" () As Integer
                [DllImport("FFACE.dll", EntryPoint = "GetFishID4")]
                public static extern int ID4();
                //Public Declare Ansi Function OnLineTime Lib "FFACE.dll" Alias "GetFIshOnlineTime" () As Short
                [DllImport("FFACE.dll", EntryPoint = "GetFIshOnlineTime")]
                public static extern short OnLineTime();
                // Public Declare Ansi Function Timeout Lib "FFACE.dll" Alias "GetFishTimeout" () As Short
                [DllImport("FFACE.dll", EntryPoint = "GetFishTimeout")]
                public static extern short Timeout();
            }
        }

        #endregion

        #region "Menu"

        public class Menu
        {
            //Public Declare Ansi Function IsOpen Lib "FFACE.dll" Alias "MenuIsOpen" () As Integer
            [DllImport("FFACE.dll", EntryPoint = "MenuIsOpen")]
            public static extern int IsOpen();
            //Public Declare Ansi Function ShopQuantity Lib "FFACE.dll" Alias "ShopQuantity" () As Byte
            [DllImport("FFACE.dll", EntryPoint = "ShopQuantity")]
            public static extern Byte ShopQuantity();
            //Public Declare Ansi Function ShopQuantityMax Lib "FFACE.dll" Alias "ShopQuantityMax" () As Byte
            [DllImport("FFACE.dll", EntryPoint = "ShopQuantityMax")]
            public static extern Byte ShopQuantityMax();
            //Private Declare Ansi Sub sName Lib "FFACE.dll" Alias "MenuName" (ByVal buffer As Byte(), ByRef size As Integer)
            [DllImport("FFACE.dll", EntryPoint = "MenuName")]
            private static extern void sName(byte[] buffer, ref int size);

            //Public Shared Function Name() As String
            //    Dim s As Integer = 40
            //    Dim b(40) As Byte
            //    sName(b, s)
            //    Return System.Text.Encoding.ASCII.GetString(b, 0, s - 1)
            //End Function
            public static string Name()
            {
                int s = 40;
                byte[] b = new byte[41];
                sName(b, ref s);
                return System.Text.Encoding.ASCII.GetString(b, 0, s - 1);
            }

            //Private Declare Ansi Sub sSelection Lib "FFACE.dll" Alias "MenuSelection" (ByVal buffer As Byte(), ByRef size As Integer)
            [DllImport("FFACE.dll", EntryPoint = "MenuSelection")]
            private static extern void sSelection(byte[] buffer, ref int size);

            //Public Shared Function Selection() As String
            //    Dim s As Integer = 60
            //    Dim b(60) As Byte
            //    sSelection(b, s)
            //    Return System.Text.Encoding.ASCII.GetString(b, 0, s - 1)
            //End Function
            public static string Selection()
            {
                int s = 60;
                byte[] b = new byte[61];
                sSelection(b, ref s);
                return System.Text.Encoding.ASCII.GetString(b, 0, s - 1);
            }

            //Private Declare Ansi Sub sHelp Lib "FFACE.dll" Alias "MenuHelp" (ByVal buffer As Byte(), ByRef size As Integer)
            [DllImport("FFACE.dll", EntryPoint = "MenuHelp")]
            private static extern void sHelp(byte[] buffer, ref int size);

            //Public Shared Function Help() As String
            //    Dim s As Integer = 150
            //    Dim b(150) As Byte
            //    sHelp(b, s)
            //    Return System.Text.Encoding.ASCII.GetString(b, 0, s - 1)
            //End Function
            public static string Help()
            {
                int s = 150;
                byte[] b = new byte[151];
                sHelp(b, ref s);
                return System.Text.Encoding.ASCII.GetString(b, 0, s - 1);
            }
        }

        #endregion

        #region "Inventory"

        public class Inventory
        {
            //Public Shared Function MaxCount() As Integer
            //    MsgBox("not in dll.")
            //    Return 0
            //End Function

            //Public Declare Ansi Function SelectedItemNumber Lib "FFACE.dll" Alias "GetSelectedItemNum" () As Integer
            [DllImport("FFACE.dll", EntryPoint = "GetSelectedItemNum")]
            public static extern int SelectedItemNum();
            //Public Declare Ansi Function Count Lib "FFACE.dll" Alias "GetInventoryCount" () As Byte
            [DllImport("FFACE.dll", EntryPoint = "GetInventoryCount")]
            public static extern Byte Count();
            //Public Declare Ansi Function SelectedItemIndex Lib "FFACE.dll" Alias "GetSelectedItemIndex" () As Byte
            [DllImport("FFACE.dll", EntryPoint = "GetSelectedItemIndex")]
            public static extern Byte SelectedItemIndex();
            //Public Declare Ansi Function ItemCountByIndex Lib "FFACE.dll" Alias "GetItemCountByIndex" (ByVal index As Byte) As Byte
            [DllImport("FFACE.dll", EntryPoint = "GetItemCountByIndex")]
            public static extern Byte SelectedItemNum(byte index);
            //Public Declare Ansi Function EquippedItemCount Lib "FFACE.dll" Alias "GetEquippedItemCount" (ByVal slot As eEquipSlot) As Byte
            [DllImport("FFACE.dll", EntryPoint = "GetEquippedItemCount")]
            public static extern Byte SelectedItemNum(eEquipSlot slot);
            //Private Declare Ansi Sub sEquippedName Lib "FFACE.dll" Alias "GetEquippedItemName" (ByVal slot As Short, ByVal buffer As Byte(), ByRef size As Integer)
            [DllImport("FFACE.dll", EntryPoint = "GetEquippedItemName")]
            private static extern void sEquippedName(short slot, byte[] buffer, ref int size);

            //Public Shared Function EquippedItemName(ByVal slot As eEquipSlot) As String
            //    Dim s As Integer = 20
            //    Dim b(20) As Byte
            //    sEquippedName(CShort(slot), b, s)
            //    Return System.Text.Encoding.ASCII.GetString(b, 0, s - 1)
            //End Function
            public static string EquippedItemName(eEquipSlot slot)
            {
                int s = 20;
                byte[] b = new byte[21];
                sEquippedName((short)slot, b, ref s);
                return System.Text.Encoding.ASCII.GetString(b, 0, s - 1);
            }

            //Private Declare Ansi Sub sSelectedName Lib "FFACE.dll" Alias "GetSelectedItemName" (ByVal buffer As Byte(), ByRef size As Integer)
            [DllImport("FFACE.dll", EntryPoint = "GetSelectedItemName")]
            private static extern void sSelectedName(byte[] buffer, ref int size);

            //Public Shared Function SelectedItemName() As String
            //    Dim s As Integer = 20
            //    Dim b(20) As Byte
            //    sSelectedName(b, s)
            //    Return System.Text.Encoding.ASCII.GetString(b, 0, s - 1)
            //End Function
            public static string SelectedItemName()
            {
                int s = 20;
                byte[] b = new byte[21];
                sSelectedName(b, ref s);
                return System.Text.Encoding.ASCII.GetString(b, 0, s - 1);
            }
        }

        #endregion
    }

    public static class Windower
    {
        public static string PolID = "";

        #region "MainFunctions"

        public static class MainFunctions
        {

            public static string KeyboardHelper = "WindowerMMFKeyboardHandler_" + PolID;
            public static string TextHelper = "WindowerMMFTextHandler_" + PolID;
            public static string ConsoleHelper = "WindowerMMFConsoleHandler_" + PolID;
            //Keyboard Helper: (MMF Name = "WindowerMMFKeyboardHandler")
            private static int mKeyboardHelper = CreateKeyboardHelper(KeyboardHelper);
            //Text Helper: (MMF Name = "WindowerMMFTextHandler")
            private static int mTextHelper = CreateTextHelper(TextHelper);
            //Console Helper: (MMF Name = "WindowerMMFConsoleHandler")
            private static int mConsoleHelper = CreateConsoleHelper(ConsoleHelper);

            //This Here Is Just A Simple Delay To Know How Long To Hold The Key Down For
            private static int KeyDownDelay = 100;

            [DllImport("WindowerHelper.dll")]
            private static extern int CreateTextHelper(string name);

            [DllImport("WindowerHelper.dll")]
            private static extern void DeleteTextHelper(int helper);

            [DllImport("WindowerHelper.dll")]
            private static extern void CTHCreateTextObject(int helper, string name);

            [DllImport("WindowerHelper.dll")]
            private static extern void CTHDeleteTextObject(int helper, string name);

            [DllImport("WindowerHelper.dll")]
            private static extern void CTHSetText(int helper, string name, string text);

            [DllImport("WindowerHelper.dll")]
            private static extern void CTHSetVisibility(int helper, string name, bool visible);

            [DllImport("WindowerHelper.dll")]
            private static extern void CTHSetFont(int helper, string name, ref byte font, short height);

            [DllImport("WindowerHelper.dll")]
            private static extern void CTHSetColor(int helper, string name, byte a, byte r, byte g, byte b);

            [DllImport("WindowerHelper.dll")]
            private static extern void CTHSetLocation(int helper, string name, float x, float y);

            [DllImport("WindowerHelper.dll")]
            private static extern void CTHSetBold(int helper, string name, bool bold);

            [DllImport("WindowerHelper.dll")]
            private static extern void CTHSetItalic(int helper, string name, bool italic);

            [DllImport("WindowerHelper.dll")]
            private static extern void CTHSetBGColor(int helper, string name, byte a, byte r, byte g, byte b);

            [DllImport("WindowerHelper.dll")]
            private static extern void CTHSetBGBorderSize(int helper, string name, float pixels);

            [DllImport("WindowerHelper.dll")]
            private static extern void CTHSetBGVisibility(int helper, string name, bool visible);

            [DllImport("WindowerHelper.dll")]
            private static extern void CTHSetRightJustified(int helper, string name, bool justified);

            [DllImport("WindowerHelper.dll")]
            private static extern void CTHFlushCommands(int helper);

            [DllImport("WindowerHelper.dll")]
            private static extern int CreateKeyboardHelper(string name);

            [DllImport("WindowerHelper.dll")]
            private static extern void DeleteKeyboardHelper(int helper);

            [DllImport("WindowerHelper.dll")]
            private static extern void CKHSetKey(int helper, byte key, bool down);

            [DllImport("WindowerHelper.dll")]
            private static extern void CKHBlockInput(int helper, bool block);

            [DllImport("WindowerHelper.dll")]
            private static extern void CKHSendString(int helper, string data);

            [DllImport("WindowerHelper.dll")]
            private static extern int CreateConsoleHelper(string name);

            [DllImport("WindowerHelper.dll")]
            private static extern void DeleteConsoleHelper(int helper);

            [DllImport("WindowerHelper.dll")]
            private static extern bool CCHIsNewCommand(int helper);

            [DllImport("WindowerHelper.dll")]
            private static extern short CCHGetArgCount(int helper);

            [DllImport("WindowerHelper.dll")]
            private static extern void CCHGetArg(int helper, short index, StringBuilder buffer);

            //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            //~~The Main Functions That Make Life Easy Start Here~~
            //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

            # region Console

            public static string[] GetArgs()
            {
                int ac = GetArgCount();
                if (IsNewCommand() && ac > 0)
                {

                    string[] buffer = new string[ac];
                    StringBuilder reply = new StringBuilder(2048);
                    buffer.Initialize();

                    for (short i = 0; i < ac; i += 1)
                    {
                        CCHGetArg(mConsoleHelper, i, reply);
                        buffer[i] = reply.ToString();
                        reply.Remove(0, reply.Length);
                    }
                    return buffer;
                }
                else
                {
                    string[] empty = new string[0];
                    return empty;
                }
            }

            public static short GetArgCount()
            {
                return CCHGetArgCount(mConsoleHelper);
            }

            public static bool IsNewCommand()
            {
                return CCHIsNewCommand(mConsoleHelper);
            }

            # endregion

            public static void SendText(string text)
            {
                CKHSendString(mKeyboardHelper, text);
            }

            public static void KeyPress(KeyCode KeyCode)
            {
                CKHSetKey(mKeyboardHelper, Convert.ToByte(KeyCode), true);
                System.Threading.Thread.Sleep(KeyDownDelay);
                CKHSetKey(mKeyboardHelper, Convert.ToByte(KeyCode), false);
            }

            //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            //~~~~~~~~~~~~~~~Works But I Don't Use It~~~~~~~~~~~~~~~
            //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            public static void KeyDown(KeyCode KeyCode, bool pressed) //to use set private to public
            {
                CKHSetKey(mKeyboardHelper, Convert.ToByte(KeyCode), pressed);
            }
            //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        }

        #endregion

        #region "KeyCodes"

        public enum KeyCode
        {
            //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            //~~~~~~~~~These Here Are The Most Important FFXI Keys~~~~~~~~~
            //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            EscapeKey = 1,

            EnterKey = 28,
            TabKey = 15,

            UpArrow = 200,
            LeftArrow = 203,
            RightArrow = 205,
            DownArrow = 208,
            //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

            //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            //~~~~~~~These Here Are The NumPad Keys On Your Keyboard~~~~~~~
            //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            MainNumlockKey = 69,

            NP_Number0 = 82,
            NP_Number1 = 79,
            NP_Number2 = 80,
            NP_Number3 = 81,
            NP_Number4 = 75,
            NP_Number5 = 76,
            NP_Number6 = 77,
            NP_Number7 = 71,
            NP_Number8 = 72,
            NP_Number9 = 73,

            NP_Forwardslash = 181,
            NP_MultiplyKey = 55,
            NP_MinusKey = 74,
            NP_AdditionKey = 78,
            NP_EnterKey = 156,
            NP_PeriodKey = 83,
            //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

            //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            //~~~These Here Are The Letters From A to Z On Your Keyboard~~~
            //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            LetterA = 30,
            LetterB = 48,
            LetterC = 46,
            LetterD = 32,
            LetterE = 18,
            LetterF = 33,
            LetterG = 34,
            LetterH = 35,
            LetterI = 23,
            LetterJ = 36,
            LetterK = 37,
            LetterL = 38,
            LetterM = 50,
            LetterN = 49,
            LetterO = 24,
            LetterP = 25,
            LetterQ = 16,
            LetterR = 19,
            LetterS = 31,
            LetterT = 20,
            LetterU = 22,
            LetterV = 47,
            LetterW = 17,
            LetterX = 45,
            LetterY = 21,
            LetterZ = 44,
            //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

            //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            //~~~These Here Are The Numbers From 0 to 9 On Your Keyboard~~~
            //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            Number1 = 2,
            Number2 = 3,
            Number3 = 4,
            Number4 = 5,
            Number5 = 6,
            Number6 = 7,
            Number7 = 8,
            Number8 = 9,
            Number9 = 10,
            Number0 = 11,
            //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

            //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            //~~These Here Are The F Keys From F1 to F12 On Your Keyboard~~
            //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            F1Key = 59,
            F2Key = 60,
            F3Key = 61,
            F4Key = 62,
            F5Key = 63,
            F6Key = 64,
            F7Key = 65,
            F8Key = 66,
            F9Key = 67,
            F10Key = 68,
            F11Key = 87,
            F12Key = 88,
            //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

            //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            //~~~~These Here Are Ones That You Should Not Need But Here~~~~
            //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            //MinusKey = 12,
            //EqualsKey = 13,
            //BackspaceKey = 14,
            //LeftBracket = 26,
            //RightBracket = 27,
            //LeftCtrlKey = 29,
            //Semicolon = 39,
            //Apostrophe = 40,
            //Accentgrave = 41,
            //LeftShift = 42,
            //Backslash = 43,
            //CommaKey = 51,
            //PeriodKey = 52,
            //ForwardslashKEy = 53,
            //RightShift = 54,
            //ScrollLock = 70,
            //LeftAltKey = 56,
            //Spacebar = 57,
            //CapsLock = 58,
            //RightControlKey = 157,
            //RightAltKey = 184,
            //InsertKey = 210,
            //DeleteKey = 211,
            //LeftWindowKey = 219,
            //RightWindowKey = 220

            //Calculator = &HA1

            //MuteKey = &HA0
            //PlayNPauseKey = &HA2
            //StopMedia = &HA
            //VolumeDown = &HAE
            //VolumeUp = &HB0
            //NextMediaTrack = &HED
            //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        }

        #endregion
    }

    #region "eStatusEffect"

    public enum eStatusEffect : short
    {
        KO = 0,
        Weakness = 1,
        Sleep = 2,
        Poison = 3,
        Paralysis = 4,
        Blindness = 5,
        Silence = 6,
        Petrification = 7,
        Disease = 8,
        Curse = 9,
        Stun = 10,
        Bind = 11,
        Weight = 12,
        Slow = 13,
        Charm1 = 14,
        Doom = 15,
        Amnesia = 16,
        Charm2 = 17,
        Terror = 28,
        Mute = 29,
        Bane = 30,
        Plague = 31,
        Flee = 32,
        Haste = 33,
        Blaze_Spikes = 34,
        Ice_Spikes = 35,
        Blink = 36,
        Stoneskin = 37,
        Shock_Spikes = 38,
        Aquaveil = 39,
        Protect = 40,
        Shell = 41,
        Regen = 42,
        Refresh = 43,
        Mighty_Strikes = 44,
        Boost = 45,
        Hundred_Fists = 46,
        Manafont = 47,
        Chainspell = 48,
        Perfect_Dodge = 49,
        Invincible = 50,
        Blood_Weapon = 51,
        Soul_Voice = 52,
        Eagle_Eye_Shot = 53,
        Meikyo_Shisui = 54,
        Astral_Flow = 55,
        Berserk = 56,
        Defender = 57,
        Aggressor = 58,
        Focus = 59,
        Dodge = 60,
        Counterstance = 61,
        Sentinel = 62,
        Souleater = 63,
        Last_Resort = 64,
        Sneak_Attack = 65,
        Copy_Image = 66,
        Third_Eye = 67,
        Warcry = 68,
        Invisible = 69,
        Deodorize = 70,
        Sneak = 71,
        Sharpshot = 72,
        Barrage = 73,
        Holy_Circle = 74,
        Arcane_Circle = 75,
        Hide = 76,
        Camouflage = 77,
        Divine_Seal = 78,
        Elemental_Seal = 79,
        STR_Boost1 = 80,
        DEX_Boost1 = 81,
        VIT_Boost1 = 82,
        AGI_Boost1 = 83,
        INT_Boost1 = 84,
        MND_Boost1 = 85,
        CHR_Boost1 = 86,
        Trick_Attack = 87,
        Max_HP_Boost = 88,
        Max_MP_Boost = 89,
        Accuracy_Boost = 90,
        Attack_Boost = 91,
        Evasion_Boost = 92,
        Defense_Boost = 93,
        Enfire = 94,
        Enblizzard = 95,
        Enaero = 96,
        Enstone = 97,
        Enthunder = 98,
        Enwater = 99,
        Barfire = 100,
        Barblizzard = 101,
        Baraero = 102,
        Barstone = 103,
        Barthunder = 104,
        Barwater = 105,
        Barsleep = 106,
        Barpoison = 107,
        Barparalyze = 108,
        Barblind = 109,
        Barsilence = 110,
        Barpetrify = 111,
        Barvirus = 112,
        Reraise = 113,
        Cover = 114,
        Unlimited_Shot = 115,
        Phalanx = 116,
        Warding_Circle = 117,
        Ancient_Circle = 118,
        STR_Boost2 = 119,
        DEX_Boost2 = 120,
        VIT_Boost2 = 121,
        AGI_Boost2 = 122,
        INT_Boost2 = 123,
        MND_Boost2 = 124,
        CHR_Boost2 = 125,
        Spirit_Surge = 126,
        Costume = 127,
        Burn = 128,
        Frost = 129,
        Choke = 130,
        Rasp = 131,
        Shock = 132,
        Drown = 133,
        Dia = 134,
        Bio = 135,
        STR_Down = 136,
        DEX_Down = 137,
        VIT_Down = 138,
        AGI_Down = 139,
        INT_Down = 140,
        MND_Down = 141,
        CHR_Down = 142,
        Level_Restriction = 143,
        Max_HP_Down = 144,
        Max_MP_Down = 145,
        Accuracy_Down = 146,
        Attack_Down = 147,
        Evasion_Down = 148,
        Defense_Down = 149,
        Physical_Shield = 150,
        Arrow_Shield = 151,
        Magic_Shield1 = 152,
        Damage_Spikes = 153,
        Shining_Ruby = 154,
        Medicine = 155,
        Flash = 156,
        Subjob_Restriction = 157,
        Provoke = 158,
        Penalty = 159,
        Preparations = 160,
        Sprint = 161,
        Enchantment = 162,
        Azure_Lore = 163,
        Chain_Affinity = 164,
        Burst_Affinity = 165,
        Overdrive = 166,
        Magic_Def_Down = 167,
        Inhibit_TP = 168,
        Potency = 169,
        Regain = 170,
        Pax = 171,
        Magic_Shield2 = 189,
        Magic_Atk_Boost = 190,
        Magic_Def_Boost = 191,
        Requiem = 192,
        Lullaby = 193,
        Elegy = 194,
        Paeon = 195,
        Ballad = 196,
        Minne = 197,
        Minuet = 198,
        Madrigal = 199,
        Prelude = 200,
        Mambo = 201,
        Aubade = 202,
        Pastoral = 203,
        Hum = 204,
        Fantasia = 205,
        Operetta = 206,
        Capriccio = 207,
        Serenade = 208,
        Round = 209,
        Gavotte = 210,
        Fugue = 211,
        Rhapsody = 212,
        Aria = 213,
        March = 214,
        Etude = 215,
        Carol = 216,
        Threnody = 217,
        Hymnus = 218,
        Mazurka = 219,
        Sirvente = 220,
        Auto_Regen = 233,
        Auto_Refresh = 234,
        Fishing_Imagery = 235,
        Woodworking = 236,
        Smithing = 237,
        Goldsmithing = 238,
        Clothcraft = 239,
        Leathercraft = 240,
        Bonecraft = 241,
        Alchemy = 242,
        Cooking = 243,
        Dedication = 249,
        Ef_Badge = 250,
        Food = 251,
        Chocobo = 252,
        Signet = 253,
        Battlefield = 254,
        Sanction = 256,
        Besieged = 257,
        Illusion = 258,
        No_Weapons_Armor = 259,
        No_Support_Job = 260,
        No_Job_Abilities = 261,
        No_Magic_Casting = 262,
        Penalty_to_Attribute_s_ = 263,
        Overload = 299,
        Fire_Maneuver = 300,
        Ice_Maneuver = 301,
        Wind_Maneuver = 302,
        Earth_Maneuver = 303,
        Thunder_Maneuver = 304,
        Water_Maneuver = 305,
        Light_Maneuver = 306,
        Dark_Maneuver = 307,
        Doubleup_Chance = 308,
        Bust = 309,
        Fighters_Roll = 310,
        Monks_Roll = 311,
        Healers_Roll = 312,
        Wizards_Roll = 313,
        Warlocks_Roll = 314,
        Rogues_Roll = 315,
        Gallants_Roll = 316,
        Chaos_Roll = 317,
        Beast_Roll = 318,
        Choral_Roll = 319,
        Hunters_Roll = 320,
        Samurai_Roll = 321,
        Ninja_Roll = 322,
        Drachen_Roll = 323,
        Evokers_Roll = 324,
        Maguss_Roll = 325,
        Corsairs_Roll = 326,
        Puppet_Roll = 327,
        Warriors_Charge = 340,
        Formless_Strikes = 341,
        Assassins_Charge = 342,
        Feint = 343,
        Fealty = 344,
        Dark_Seal = 345,
        Diabolic_Eye = 346,
        Nightingale = 347,
        Troubadour = 348,
        Killer_Instinct = 349,
        Stealth_Shot = 350,
        Flashy_Shot = 351,
        Sange = 352,
        Hasso = 353,
        Seigan = 354
    }

    #endregion

    #region "eSpellList"

    public enum eSpellList : short
    {
        //~~~~~~~~~~~~~~~~~~~~~~~~~
        //~~~~~Healing Magic~~~~~~~
        //~~~~~~~~~~~~~~~~~~~~~~~~~

        Cure = 0,
        Poisona = 26,
        Paralyna = 28,
        Cure_II = 2,
        Blindna = 30,
        Curaga = 12,
        Silena = 32,
        Cure_III = 4,
        Raise = 22,
        Cursna = 38,
        Curaga_II = 14,
        Reraise = 268,
        Viruna = 36,
        Stona = 34,
        Cure_IV = 6,
        Curaga_III = 16,
        Raise_II = 24,
        Reraise_II = 280,
        Cure_V = 8,
        Curaga_IV = 18,
        Raise_III = 278,
        Reraise_III = 282,


        //~~~~~~~~~~~~~~~~~~~~~~~~~
        //~~~~~~Divine Magic~~~~~~~
        //~~~~~~~~~~~~~~~~~~~~~~~~~

        Banish = 54,
        Banshiga = 74,
        Holy = 40,
        Banish_II = 56,
        Banishga_II = 76,
        Flash = 222,
        Banish_III = 58,

        //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        //~~~~~~Enfeebling Magic~~~~~~~
        //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

        Dia = 44,
        Poison = 438,
        Paralyze = 114,
        Blind = 506,
        Bind = 514,
        Slow = 110,
        Diaga = 64,
        Silence = 116,
        Poisonga = 448,
        Sleep = 504,
        Dia_II = 46,
        Dispel = 518,
        Poison_II = 440,
        Sleep_II = 516,
        Dia_III = 48,
        Gravity = 430,

        //~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        //~~~~~~Enhancing Magic~~~~~~~
        //~~~~~~~~~~~~~~~~~~~~~~~~~~~~

        Barstone = 124,
        Barstonra = 136,
        Barsleep = 142,
        Barsleepra = 170,
        Protect = 84,
        Protectra = 248,
        Barwater = 128,
        Barwatera = 140,
        Barpoison = 144,
        Barpoisonra = 172,
        Aquaveil = 108,
        Barparalyze = 146,
        Barparalyzra = 174,
        Baraero = 122,
        Baraera = 134,
        Deodorize = 274,
        Enthunder = 206,
        Barfire = 118,
        Barfira = 130,
        Shell = 94,
        Shellra = 258,
        Warp = 520,
        Barblind = 148,
        Barblindra = 176,
        Enstone = 206,
        Blaze_Spikes = 496,
        Enaero = 202,
        Sneak = 272,
        Barblizzard = 120,
        Barblizzara = 132,
        Regen = 214,
        Enblizzard = 200,
        Barsilence = 150,
        Barsilencera = 178,
        Blink = 104,
        Enfire = 198,
        Barthunder = 126,
        Barthundra = 138,
        Invisible = 270,
        Enwater = 208,
        Protect_II = 86,
        Protectra_II = 248,
        Escape = 524,
        Phalanx = 210,
        Stoneskin = 106,
        Erase = 284,
        Teleport_Dem = 244,
        Teleport_Holla = 242,
        Teleport_Mea = 246,
        Shell_II = 96,
        Shellra_II = 260,
        Teleport_Altep = 240,
        Teleport_Yhoat = 238,
        Barvirus = 154,
        Barvira = 182,
        Teleport_Vahzl = 276,
        Ice_Spikes = 498,
        Warp_II = 522,
        Refresh = 216,
        Barpetrify = 152,
        Barpetra = 180,
        Regen_II = 218,
        Protect_III = 88,
        Protectra_III = 252,
        Haste = 112,
        Shell_III = 98,
        Shellra_III = 262,
        Shock_Spikes = 500,
        Protect_IV = 90,
        Protectra_IV = 254,
        Regen_III = 220,
        Shell_IV = 100,
        Shellra_IV = 264,
        Protectra_V = 256,
        Shellra_V = 266,
        Phalanx_II = 212
    }

    #endregion

    #region "eStatus"

    public enum eStatus : byte
    {
        Standing = 0,
        Fighting = 1,
        Dead1 = 2,
        Dead2 = 3,
        _Event = 4, //event is already used in C# itself.
        Chocobo = 5,
        Fishing = 6,
        Healing = 33,
        FishBite = 38,
        Obtained = 39,
        RodBreak = 40,
        LineBreak = 41,
        LostCatch = 43,
        CatchMonster = 42,
        Synthing = 44,
        Sitting = 47
    }

    #endregion

    #region "eElement"

    public enum eElement : byte
    {
        Light = 6,
        Dark = 7,
        Lightning = 4,
        Water = 5,
        Fire = 0,
        Earth = 3,
        Air = 2,
        Ice = 1,
        Unknown = 15
    }

    #endregion

    #region "eSkill"

    public enum eSkill : byte
    {
        All = 255,
        Dark_Magic = 25,
        Elemental_Magic = 24,
        Enfeebling_Magic = 23,
        Healing_Magic = 21,
        Enhancing_Magic = 22,
        Divine_Magic = 20,
        Singing = 28,
        Stringed_Instrument = 29,
        Wind_Instrument = 30,
        Blue_Magic = 1,
        Ninjutsu_Magic = 27,
        Summoning_Magic = 26,
        // Artbitrary values from here.
        H2H_Combat = 50,
        Dagger_Combat = 51,
        Sword_Combat = 52,
        GreatSword_Combat = 53,
        Axe_Combat = 54,
        GreatAxe_Combat = 55,
        Scythe_Combat = 56,
        Polearm_Combat = 57,
        Katana_Combat = 58,
        GreatKatana_Combat = 59,
        Club_Combat = 60,
        Staff_Combat = 61,
        Archery_Ranged = 80,
        Marksmanship_Ranged = 81,
        Throwing_Ranged = 82,
        Guard_Defense = 100,
        Evasion_Defense = 101,
        Shield_Defense = 102,
        Parrying_Defense = 103
    }

    #endregion

    #region "eEquipSlot"

    public enum eEquipSlot : short
    {
        Main = 0,
        Shield = 1,
        Range = 2,
        Ammo = 3,
        Head = 4,
        Body = 5,
        Hands = 6,
        Legs = 7,
        Feet = 8,
        Neck = 9,
        Waist = 10,
        EarLeft = 11,
        EarRight = 12,
        RingLeft = 13,
        RingRight = 14,
        Back = 15
    }

    #endregion

    #region "eRodAlign"

    public enum eRodAlign : byte
    {
        Err = 0,
        Center = 1,
        Left = 2,
        Right = 3
    }

    #endregion

    #region "eWeather"

    public enum eWeather : short
    {
        Clear = 0,
        Sunshine = 1,
        Clouds = 2,
        Fog = 3,
        Fire = 4,
        Fire_x2 = 5,
        Water = 6,
        Water_x2 = 7,
        Earth = 8,
        Earth_x2 = 9,
        Wind = 10,
        Wind_x2 = 11,
        Ice = 12,
        Ice_x2 = 13,
        Thunder = 14,
        Thunder_x2 = 15,
        Light = 16,
        Light_x2 = 17,
        Dark = 18,
        Dark_x2 = 19
    }

    #endregion

    #region "eChatMode"

    public enum eChatMode
    {
        //------------------------------------------------------------------------------------------'
        //--------------------------------------Tekz eChatModes-------------------------------------'
        //------------------------------------------------------------------------------------------'

        Unknown = 0,
        // Catch all.

        //--------------------------------------------------------------'
        //-Text That's Been Sent To The ChatLog By You aKa (The Player-)'
        //--------------------------------------------------------------'
        SentSay = 1,
        // = A Say Msg That The Used Sends 
        SentShout = 2,
        // = A Shout Msg That The Used Sends
        SentTell = 4,
        // = my Tell to someone else
        SentParty = 5,
        // = my msg to Party
        SentLinkShell = 6,
        // = my msg to my linkshell

        //--------------------------------------------------------------'
        //----Text That's Been Recieved In ChatLog By Other Players-----'
        //--------------------------------------------------------------'
        RcvdSay = 9,
        // = A Say Msg That The Used Will See From Someone Else
        RcvdShout = 10,
        // = A Shout Msg That The Used Will See From Someone Else
        RcvdTell = 12,
        // = received a Tell
        RcvdParty = 13,
        // = received party text -- Thanks to AcidFang for this value (v1.5.4)
        RcvdLinkShell = 14,
        // = incoming linkshell text

        //--------------------------------------------------------------'
        //-----------You aKa (The Player's) Fight Log Stuff-------------'
        //--------------------------------------------------------------'
        PlayerzFightLog = 20,
        // eg. Teknical hits the Thread Leech for 63 points of damage.
        PlayerDefeats = 36,
        // eg. Teknical Defeats the River Crab. or whatever
        PlayerStartCasting = 50,
        // eg. Teknical starts casting Dia on the Thread Leech.
        PlayerUsesJobAbility = 101,
        // eg. Teknical uses Divine Seal.
        PlayerReadiesMove = 110,
        // eg. The Thread Leech readies Brain Drain.
        PlayersBadCast = 122,
        // eg. Inturrupted or Unable to Cast. eg: Unable To Cast That Spell

        //--------------------------------------------------------------'
        //-----The Other Player aKa (The Target's) Fight Log Stuff------'
        //--------------------------------------------------------------'
        TargetUsesJobAbility = 22,
        // eg. The Thread Leech uses TP Drainkiss.
        TargetFightLog = 28,
        // eg. The Thread Leech hits Teknical for 4 points of damage.
        TargetReadiesMove = 100,
        // eg. Teknical readies Rock Crusher.
        TargetMisses = 29,
        // eg. The Thread Leech misses Teknical.

        Emote1 = 7,
        // = Emote1
        Emote2 = 15,
        // = Emote2

        Echo = 206,
        //// = echo

        EffectWearOff = 191,
        // eg. Teknical's Protect effect wears off

        SomeoneDefeats = 44,
        // = somebody "defeats the" river crab or whatever
        SynthResult = 121,
        // = you throw away a rusty subligar or whatever
        TellNotRcvd = 123,
        // = your tell was not received
        SkillBoost = 129,
        // = you fishing skill rises 0.1 points
        ItemSold = 138,
        // = item sold


        FishResult = 148,
        // = fishing result including: 
        //-You didn't catch anything=,
        //-You lost your catch, 
        //-Whatever caught the hook was too small to catch, 
        //-Obtained: rust subligar or whatever, 
        //-Your line broke
        CaughtOnHook = 152,
        //// = something caught on hook
        DropRipCap = 159,
        //// = you release the ripped cap regretfully

        CommandError = 157,
        //// = A command error occurred

        RegConquest = 161,
        //// = regional conquest update message
        ServerNotice = 200
        //// = notice of upcoming server maintenance
    }

    #endregion
}
